CVE-2026-108381: 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.44.0 through 0.70.5. The vulnerability arises because the Pydantic and AvroDantic model generators insert schema field annotations without safely restricting expressions, allowing arbitrary Python code execution when the generated module is imported. This issue is fixed in version 0.70.6 by restricting the annotation values to safe expressions.
CVSS v3.1
Score 8.8high
Affected software
marcosschroh
dataclasses-avroschema
Run 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 Python dataclasses, Pydantic models, and Faust Records. In versions 0.44.0 through 0.70.5, the Pydantic and AvroDantic model generators insert a schema field's pydantic-class value after 'pydantic.' in a generated field annotation without proper validation. Since annotations are evaluated at module import time, a crafted malicious value can lead to arbitrary code execution. Version 0.70.6 addresses this by restricting the annotation value to a bare name or a call to a bare name with literal arguments, preventing code injection.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code on the system importing the generated module, potentially leading to full compromise of confidentiality, integrity, and availability of the affected system.
Mitigation Recommendations
Upgrade dataclasses-avroschema to version 0.70.6 or later, where the vulnerability is fixed by restricting annotation values to safe expressions. No other mitigations are indicated.
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: 6ace6f1b2cdf04f656910f49
Added to database: 10/13/2026, 17:49:15 UTC
Last enriched: 10/13/2026, 18:03:34 UTC
Last updated: 10/13/2026, 18:57:33 UTC
Views: 6
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.