CVE-2026-108379: dataclasses-avroschema fixed namespaces allow code injection in generated annotations
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, BaseGenerator.parsefixed inserts a fixed type's namespace value between quotes inside a generated types.confixed annotation without escaping or validating it. A crafted quote can terminate the namespace string and alter the surrounding annotation expression, which Python evaluates when the generated class is defined, allowing arbitrary code execution. Version 0.70.6 fixes the vulnerability by requiring the namespace to be a dot-separated sequence of valid Avro names.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
dataclasses-avroschemato a version that resolves this vulnerability.Fixed in 0.70.6
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using dataclasses-avroschema versions 0.38.0 through 0.70.5 are exposed when they generate Python code from Avro schemas containing fixed types. The affected path is BaseGenerator.parse_fixed.
What must an attacker control to exploit it?
An attacker needs to supply or influence an Avro fixed type namespace used during Python code generation. The namespace must contain a crafted quote that escapes the generated annotation string and changes the Python expression evaluated when the generated class is defined.
Is user interaction required?
Yes. The supplied vector indicates user interaction is required, and exploitation occurs when the crafted schema is processed to generate Python code and the resulting class definition is evaluated.
What should teams do if they cannot immediately upgrade?
Do not generate Python code from untrusted Avro schemas, particularly schemas with fixed types and attacker-controlled namespace values. Restrict accepted namespaces to dot-separated valid Avro names before invoking the affected generator.
How can I determine whether I am affected?
Check whether your installed dataclasses-avroschema version is between 0.38.0 and 0.70.5 inclusive, and whether your workflow uses generated Python code from Avro schemas. Review fixed type namespace inputs for quotes or values that are not dot-separated valid Avro names.