CVE-2026-108380: 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.65.9 through 0.70.5, PydanticFieldRepresentation.add_field_properties inserts a schema field's doc value between the quotes of a generated pydantic.Field description argument without escaping it. A crafted quote can terminate the string and inject an expression evaluated during generated class definition, allowing arbitrary Python code execution for Pydantic and AvroDantic model generation. Version 0.70.6 fixes the vulnerability by escaping the documentation value before rendering it.
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 Python dataclasses, Pydantic models, and Faust Records. In versions 0.65.9 through 0.70.5, the add_field_properties method in PydanticFieldRepresentation inserts the doc string of a schema field directly into a pydantic.Field description argument without escaping quotes. An attacker can craft a doc string containing quotes to terminate the string and inject Python expressions that are evaluated during the generated class definition. This leads to arbitrary code execution during Pydantic and AvroDantic model generation. The vulnerability is resolved in version 0.70.6 by escaping the doc string before rendering.
Potential Impact
Successful exploitation allows an unauthenticated attacker to execute arbitrary Python code during the generation of Pydantic and AvroDantic models. This can lead to full system compromise, data loss, or denial of service. The CVSS 3.1 score is 8.8 (high), 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 the documentation value before rendering. No other mitigation is required as the fix addresses the root cause.
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: 6ace6f1b2cdf04f656910f48
Added to database: 10/13/2026, 17:49:15 UTC
Last enriched: 10/13/2026, 18:03:43 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.