CVE-2026-108378: CWE-94: Improper Control of Generation of Code ('Code Injection') in marcosschroh dataclasses-avroschema
Description
CVE-2026-108378 is a code injection vulnerability in the dataclasses-avroschema Python library versions 0.40.0 through 0.70.5. The issue arises because the ClassRepresentation.render_docstring method copies schema record docstrings into generated Python class docstrings without properly escaping quotes or backslashes. This allows an attacker to inject Python code that executes during module import. The vulnerability is fixed in version 0.70.6 by escaping unsafe characters in docstrings.
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. Between versions 0.40.0 and 0.70.5, the ClassRepresentation.render_docstring method directly inserts schema record docstrings into generated class docstrings without escaping triple quotes or backslashes. An attacker can craft a triple-quote sequence to prematurely close the docstring and inject arbitrary Python statements into the class body. Additionally, a trailing backslash can escape the closing delimiter, enabling code execution during module import. Version 0.70.6 addresses this by escaping quotes, backslashes, and unsafe control characters before rendering docstrings, mitigating the injection risk.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code during module import, leading to full confidentiality, integrity, and availability compromise of the affected system. 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 proper escaping of quotes, backslashes, and unsafe control characters in generated docstrings. No other mitigation is indicated or required.
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: 6ace6f182cdf04f656910f3d
Added to database: 10/13/2026, 17:49:12 UTC
Last enriched: 10/13/2026, 18:03:58 UTC
Last updated: 10/13/2026, 18:57:33 UTC
Views: 5
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.