CVE-2026-108385: dataclasses-avroschema enum symbols can inject statements through generated member names
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.parseenum and EnumRepresentation.rendersymbols use each schema-controlled enum symbol as a generated enum member name after case conversion but without validating it as an identifier. When generator classes are used directly, newlines and punctuation can inject constrained statements into the generated enum class body, allowing namespace modification or preventing the module from loading. Version 0.70.6 fixes the vulnerability by validating every enum symbol as a name.
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 directly use generator classes to generate Python code from Avro schemas containing attacker-controlled enum symbols. Code paths that only generate Avro schemas from trusted Python models are not identified as affected by the provided information.
What must an attacker control to exploit it?
An attacker needs to supply or influence an Avro schema enum symbol processed by BaseGenerator.parse_enum or EnumRepresentation.render_symbols. The symbol must reach Python code generation, where it is case-converted and inserted into an enum class body without identifier validation.
Is user interaction required?
Yes. The supplied severity vector includes UI:R, indicating that a user must cause the vulnerable generator workflow to process the malicious schema.
What can happen if exploitation succeeds?
Injected newlines or punctuation can introduce constrained statements into the generated enum class body. This can modify the generated module's namespace or make the module fail to load.
How should this be remediated?
Upgrade to version 0.70.6, which validates every enum symbol as a name. Until upgrading, do not directly generate Python code from untrusted Avro schemas, and validate enum symbols as valid Python identifiers before they reach the generator.