IT SBIT Services
Schneeberger
DEEN
CVE tracker

dataclasses-avroschema: Code injection via enum defaults in generated modules

CVE-2026-108383High 8.8

← All vulnerabilities

Summary

The Python library dataclasses-avroschema generates Python code from Avro schemas. In versions 0.38.0 through 0.70.5, enum field defaults from the schema are written into the generated module without identifier validation, so a crafted schema can inject additional statements. An attacker who controls the schema could modify the module namespace or stop the generated module from loading. Exploitation requires that a developer or pipeline generates code from the untrusted schema and then imports it.

Affected

  • dataclasses-avroschema versions 0.38.0 through 0.70.5 (CVE record)
  • Mend lists the affected range as starting at 0.70.0, not 0.38.0

Fixed in

  • Upgrade to dataclasses-avroschema 0.70.6, which validates enum defaults as names.

Workaround

  • No vendor-documented workaround for unpatched versions.
  • Until the upgrade: generate code only from trusted schemas and review generated modules before import.

Exploitation

  • No known exploitation in the wild; no KEV listing found.
  • No public proof-of-concept found for this CVE.
  • CISA SSVC: exploitation none, automatable no, technical impact total.
  • The maintainer rates the impact as narrower than arbitrary code execution; case folding often breaks injected code syntactically.
  • The CVSS score differs by source: CNA 8.8, VulDB 6.3, Mend CVSS v4 8.7.

Our recommendation

  • Upgrade every environment that uses dataclasses-avroschema for code generation to 0.70.6.
  • Until then, generate code only from trusted, internally controlled Avro schemas.
  • Review generated modules before importing them, especially those produced from third-party schemas.
  • Check CI pipelines and developer machines for affected versions, for example with pip show dataclasses-avroschema.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 19:43.

Original description (NVD)

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.

NVD references (4)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.