CVE-2026-108384: dataclasses-avroschema allows code injection through fixed-type aliases supplied as a bare string
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 interpolates a fixed type's aliases value directly into a generated types.confixed annotation. A list is represented with quoted entries, but a bare string is emitted as an unquoted Python expression and evaluated when the generated module is imported, allowing arbitrary code execution from a crafted schema. Version 0.70.6 fixes the vulnerability by rejecting aliases values that are not lists.
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 issue is triggered when the generated module is imported.
What does an attacker need to exploit it?
An attacker needs to supply or influence an Avro schema with a fixed type whose aliases field is a bare string rather than a list. User interaction is required according to the provided vector, and the crafted schema must be processed into generated Python code and imported.
Are normal list-form aliases affected?
The described unsafe behavior applies to aliases supplied as a bare string. List-form aliases are emitted with quoted entries and are not described as vulnerable.
What should be done if upgrading is not immediately possible?
Do not generate and import Python modules from untrusted Avro schemas, and reject fixed-type aliases values unless they are lists. This mirrors the validation introduced in version 0.70.6.
How can I determine whether my environment is affected?
Check whether dataclasses-avroschema is installed at a version from 0.38.0 through 0.70.5 and whether your workflow generates Python code from Avro schemas. Review schemas accepted by that workflow for fixed-type aliases represented as bare strings.