CVE-2026-108377

dataclasses-avroschema allows code injection through generated Meta.schema_name

Published Oct 13, 2026 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

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 available
History
Type Values Removed Values Added
First Time appeared Marcosschroh
Marcosschroh dataclasses-avroschema
Vendors & Products Marcosschroh
Marcosschroh dataclasses-avroschema
Type Values Removed Values Added
Metrics ssvc

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

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'}

Weaknesses
  • CWE-94

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 13, 2026, 5:49 PM
Reserved
Oct 9, 2026, 9:36 PM
Status
Awaiting Analysis
Published
Oct 13, 2026, 6:17 PM
Modified
Oct 16, 2026, 4:00 PM