CVE-2026-108375: CWE-94: Improper Control of Generation of Code ('Code Injection') in marcosschroh dataclasses-avroschema
Description
A code injection vulnerability (CWE-94) exists in dataclasses-avroschema versions 0.38.0 through 0.70.5. The vulnerability arises because FieldRepresentation.get_field_default inserts certain schema-controlled default values into generated Python source code without proper escaping. This allows crafted defaults to break out of string literals and inject arbitrary code that executes when the generated module is imported. The issue is fixed in version 0.70.6 by escaping schema values in generated string literals.
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
dataclasses-avroschema is a tool that generates Avro schemas from Python dataclasses and related models, and also generates Python code from Avro schemas. In versions 0.38.0 through 0.70.5, the method FieldRepresentation.get_field_default inserts schema-controlled string, UUID, bytes, and fixed field defaults directly into quoted literals in the generated Python source code without escaping. This improper control of code generation allows an attacker to craft a default value that terminates the string literal and injects arbitrary Python statements into the generated module. These injected statements execute upon module import, leading to code injection. Version 0.70.6 addresses this vulnerability by properly escaping schema values rendered into generated string literals.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code in the context of the importing process. This can lead to full compromise of the application using dataclasses-avroschema, including confidentiality, integrity, and availability impacts. The CVSS 3.1 base score is 8.8 (high severity), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Upgrade dataclasses-avroschema to version 0.70.6 or later, where the vulnerability is fixed by escaping schema values in generated string literals. No other mitigations are specified or recommended. Users should apply this official fix to prevent code injection via crafted schema defaults.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-09T21:36:27.042Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ace6b952cdf04f6568f1529
Added to database: 10/13/2026, 17:34:13 UTC
Last enriched: 10/13/2026, 17:48:23 UTC
Last updated: 10/13/2026, 18:57:33 UTC
Views: 8
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.