CVE-2026-108382: CWE-94: Improper Control of Generation of Code ('Code Injection') in marcosschroh dataclasses-avroschema
Description
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, EnumRepresentation.render_symbols concatenates each schema-controlled enum symbol between double quotes in a generated enum assignment. When generator classes are used directly, a quote can terminate the string literal and inject arbitrary Python code into the enum class body, which executes when the generated module is imported. Version 0.70.6 fixes the vulnerability by escaping enum symbol values before rendering them.
CVSS v3.1
Score 8.8high
Affected software
marcosschroh
dataclasses-avroschema
pkg:pypi/dataclasses-avroschemaRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The dataclasses-avroschema library generates Python code from Avro schemas, including enum assignments. In versions 0.38.0 through 0.70.5, the EnumRepresentation.render_symbols method concatenates enum symbols directly into string literals without proper escaping. This allows an attacker to inject arbitrary Python code by including a quote character in an enum symbol, terminating the string literal and injecting code into the enum class body. The injected code executes upon import of the generated module. Version 0.70.6 addresses this vulnerability by escaping enum symbol values before rendering, preventing code injection.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code in the context of the importing process, potentially leading to full system compromise, data theft, or disruption of service. The vulnerability has a high CVSS score of 8.8, indicating critical confidentiality, integrity, and availability impacts. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade dataclasses-avroschema to version 0.70.6 or later, where the vulnerability is fixed by escaping enum symbol values before rendering. Users should avoid using vulnerable versions (>=0.38.0 <0.70.6) for code generation. No additional mitigations are specified by the vendor advisory.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-09T21:36:27.043Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ace6f1b2cdf04f656910f4a
Added to database: 10/13/2026, 17:49:15 UTC
Last enriched: 10/13/2026, 18:03:26 UTC
Last updated: 10/13/2026, 18:57:33 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.