Description
dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.62.3 through 0.70.5, ClassRepresentation.render_metaclass inserts a schema-controlled Avro record name into the quoted Meta.schema_name field of generated Python source without escaping it. A crafted name can terminate the string literal and inject statements into the generated class body, which execute when the generated module is imported. Version 0.70.6 fixes the vulnerability by escaping schema values rendered into generated string literals.
Published: 2026-10-13
Score: 8.8 High
EPSS: n/a
KEV: No
Impact: Arbitrary code execution via unintended Python code injection.
Action: Apply Patch
AI Analysis

Impact

dataclasses-avroschema can generate Avro schemas from Python dataclasses and generate Python code from Avro schemas. Between versions 0.62.3 and 0.70.5 the rendered ClassRepresentation.render_metaclass inserts a schema-controlled Avro record name directly into the quoted Meta.schema_name field without escaping. A crafted name can therefore terminate the string literal and inject arbitrary statements into the generated class body. When the resulting module is imported, the injected code executes, giving the attacker full control over the process. The uncontrolled code runs with the same privileges as the importing application, potentially compromising confidentiality, integrity, or availability.

Affected Systems

Vendor Marcosschroh develops the dataclasses-avroschema library. All releases from 0.62.3 through 0.70.5 are vulnerable. Version 0.70.6 contains a fix that properly escapes schema values rendered into string literals. Any setup that depends on an unpatched version of the library and generates Avro schemas based on user supplied metadata is at risk.

Risk and Exploitability

The CVSS score of 8.8 denotes high severity. Because the vulnerability is exercised when the generated code is imported, an attacker can trigger it by providing a malicious schema name to any function that outputs a dialect or generates a schema representation. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, but its impact is significant for any environment that generates modules from untrusted input. Exploitation requires only the ability to influence the schema name; no additional privileges are needed beyond those of the importing process. Given the lack of an official workaround, timely patching is essential to mitigate this risk.

Generated by OpenCVE AI on October 13, 2026 at 18:53 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the dataclasses-avroschema library to version 0.70.6 or later to apply the escaping fix.
  • Validate or sanitize any schema name supplied to the library to ensure it cannot terminate the Meta.schema_name string literal.
  • If upgrading is not immediately possible, avoid importing modules generated from untrusted input or execute the generation in a restricted, isolated environment.

Generated by OpenCVE AI on October 13, 2026 at 18:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 13 Oct 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 13 Oct 2026 17:45:00 +0000

Type Values Removed Values Added
Description dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.62.3 through 0.70.5, ClassRepresentation.render_metaclass inserts a schema-controlled Avro record name into the quoted Meta.schema_name field of generated Python source without escaping it. A crafted name can terminate the string literal and inject statements into the generated class body, which execute when the generated module is imported. Version 0.70.6 fixes the vulnerability by escaping schema values rendered into generated string literals.
Title dataclasses-avroschema allows code injection through generated Meta.schema_name
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-13T17:49:08.751Z

Reserved: 2026-10-09T21:36:27.042Z

Link: CVE-2026-108377

cve-icon Vulnrichment

Updated: 2026-10-13T17:48:44.524Z

cve-icon NVD

Status : Received

Published: 2026-10-13T18:17:16.697

Modified: 2026-10-13T18:17:16.697

Link: CVE-2026-108377

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-13T19:00:06Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')