Description
dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.38.0 through 0.70.5, FieldRepresentation.get_field_default renders a schema-controlled enum field default as an enum member reference after applying case conversion but without validating it as an identifier. Newlines, operators, and punctuation can escape the intended reference and inject constrained statements into the generated module, allowing namespace modification or preventing the module from loading. Version 0.70.6 fixes the vulnerability by validating enum defaults as names.
Published: 2026-10-13
Score: 8.8 High
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

The vulnerability lies in the dataclasses-avroschema library’s method for rendering enum defaults within generated Python code. The code generation routine accepts default values for enum fields without validating them as identifiers. An attacker can embed newlines, operators, or punctuation in the default, causing the rendered code to contain arbitrary Python statements. This allows injection of code that modifies the module’s namespace or prevents loading, effectively providing remote code execution during import.

Affected Systems

Vulnerable releases of the library run from version 0.38.0 up to and including 0.70.5, all maintained by marcosschroh. The bug was addressed in release 0.70.6. Systems that depend on these older versions and generate Python modules from Avro schemas are at risk.

Risk and Exploitability

The CVSS score of 8.8 indicates a high severity vulnerability. With no EPSS score available, the likelihood of exploitation in the wild is uncertain but the high severity suggests careful monitoring. Because the bug manifests when the library processes untrusted schema data, an attacker who can supply or influence Avro schemas can inject code. The vulnerability is not listed in the CISA KEV catalog, implying no widespread existing exploits are known. Still, the combination of high impact and potential for exploitation warrants immediate patching unless a temporary mitigation is in place.

Generated by OpenCVE AI on October 13, 2026 at 20:17 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade dataclasses-avroschema to version 0.70.6 or later to apply the fix that validates enum defaults as identifier names.
  • Validate all Avro schema inputs before passing them to the library, ensuring that enum defaults contain only valid Python identifier characters.
  • If upgrading is not immediately possible, isolate the generation process from untrusted data or perform the import in a sandboxed environment to limit the impact of injected code.

Generated by OpenCVE AI on October 13, 2026 at 20:17 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 21 Oct 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Marcosschroh
Marcosschroh dataclasses-avroschema
Vendors & Products Marcosschroh
Marcosschroh dataclasses-avroschema

Wed, 14 Oct 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Tue, 13 Oct 2026 18:00: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.38.0 through 0.70.5, FieldRepresentation.get_field_default renders a schema-controlled enum field default as an enum member reference after applying case conversion but without validating it as an identifier. Newlines, operators, and punctuation can escape the intended reference and inject constrained statements into the generated module, allowing namespace modification or preventing the module from loading. Version 0.70.6 fixes the vulnerability by validating enum defaults as names.
Title dataclasses-avroschema enum field defaults can inject statements into generated modules
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

Marcosschroh Dataclasses-avroschema
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-14T15:58:33.201Z

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

Link: CVE-2026-108383

cve-icon Vulnrichment

Updated: 2026-10-14T15:57:46.218Z

cve-icon NVD

Status : Awaiting Analysis

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

Modified: 2026-10-16T16:00:33.533

Link: CVE-2026-108383

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-21T20:24:53Z

Weaknesses
  • CWE-94

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