CVE-2026-108376: CWE-94: Improper Control of Generation of Code ('Code Injection') in marcosschroh dataclasses-avroschema
Description
A code injection vulnerability exists in dataclasses-avroschema versions 0.47.3 through 0.70.5. The issue arises because the software inserts a schema-controlled record name into a callable position in generated Python code without validating it properly. This allows a crafted record name to execute arbitrary Python expressions when the generated model instance consumes the field default. The vulnerability is fixed in version 0.70.6 by enforcing Avro name grammar validation on record names.
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 generates Avro schemas and Python code from those schemas. Versions 0.47.3 through 0.70.5 contain a vulnerability in FieldRepresentation.get_field_default where a record name from the schema is inserted into a default_factory lambda without validation. This allows an attacker to supply a crafted record name that becomes an arbitrary Python expression, leading to code injection when the default value is evaluated. Version 0.70.6 addresses this by rejecting record names that do not conform to Avro name grammar.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code within the context of the application consuming the generated model. This can lead to full compromise of confidentiality, integrity, and availability of the affected system. The CVSS score of 8.8 reflects high impact with 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, which includes validation of record names against Avro name grammar to prevent code injection. This official fix fully mitigates the vulnerability. No additional actions are required once the upgrade is applied.
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
- Is Cloud Service
- true
Threat ID: 6ace6b952cdf04f6568f152a
Added to database: 10/13/2026, 17:34:13 UTC
Last enriched: 10/13/2026, 17:48:17 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.