CVE-2026-108377: dataclasses-avroschema allows code injection through generated Meta.schema_name
dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.62.3 through 0.70.5, ClassRepresentation.rendermetaclass inserts a schema-controlled Avro record name into the quoted Meta.schemaname field of generated Python source without escaping it. A crafted name can terminate the string literal and inject statements into the generated class body, which execute when the generated module is imported. Version 0.70.6 fixes the vulnerability by escaping schema values rendered into generated string literals.
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
Which workflows are exposed to this issue?
Workflows that generate Python code from Avro schemas using affected dataclasses-avroschema versions are exposed when they process an attacker-controlled or otherwise untrusted Avro record name. The injected code runs when the generated Python module is imported.
Does exploitation require authentication or special access?
No privileges are required according to the provided CVSS vector, but exploitation requires a victim to interact with a crafted schema so that Python code is generated and later imported.
What versions should be remediated?
Versions 0.62.3 through 0.70.5 are affected. Upgrade to version 0.70.6, which escapes schema values rendered into generated string literals.
What can be done if an immediate upgrade is not possible?
Do not generate or import Python modules from untrusted Avro schemas. Restrict schema record names to trusted, validated values before code generation.
How can teams determine whether they may already be affected?
Review generated Python source for Meta.schema_name values derived from external schemas, especially values containing quotes or Python statement syntax. Also identify whether generated modules from untrusted schemas were imported while using an affected version.