Skip to main content

CVE-2026-108382: CWE-94: Improper Control of Generation of Code ('Code Injection') in marcosschroh dataclasses-avroschema

0
High
VulnerabilityCVE-2026-108382cvecve-2026-108382cwe-94
Published: 10/13/2026 (10/13/2026, 17:44:36 UTC)
Source: CVE Database V5
Vendor/Project: marcosschroh
Product: 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.38.0 through 0.70.5, EnumRepresentation.render_symbols concatenates each schema-controlled enum symbol between double quotes in a generated enum assignment. When generator classes are used directly, a quote can terminate the string literal and inject arbitrary Python code into the enum class body, which executes when the generated module is imported. Version 0.70.6 fixes the vulnerability by escaping enum symbol values before rendering them.

CVSS v3.1

Score 8.8high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

marcosschroh

dataclasses-avroschema

Affected versions
>=0.38.0 <0.70.6
dataclasses-avroschema
pkg:pypi/dataclasses-avroschema
Affected versions
>=0.38.0 <0.70.6

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/13/2026, 18:03:26 UTC

Technical Analysis

The dataclasses-avroschema library generates Python code from Avro schemas, including enum assignments. In versions 0.38.0 through 0.70.5, the EnumRepresentation.render_symbols method concatenates enum symbols directly into string literals without proper escaping. This allows an attacker to inject arbitrary Python code by including a quote character in an enum symbol, terminating the string literal and injecting code into the enum class body. The injected code executes upon import of the generated module. Version 0.70.6 addresses this vulnerability by escaping enum symbol values before rendering, preventing code injection.

Potential Impact

Successful exploitation allows an attacker to execute arbitrary Python code in the context of the importing process, potentially leading to full system compromise, data theft, or disruption of service. The vulnerability has a high CVSS score of 8.8, indicating critical confidentiality, integrity, and availability impacts. No known exploits in the wild have been reported.

Mitigation Recommendations

Upgrade dataclasses-avroschema to version 0.70.6 or later, where the vulnerability is fixed by escaping enum symbol values before rendering. Users should avoid using vulnerable versions (>=0.38.0 <0.70.6) for code generation. No additional mitigations are specified by the vendor advisory.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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: 6ace6f1b2cdf04f656910f4a

Added to database: 10/13/2026, 17:49:15 UTC

Last enriched: 10/13/2026, 18:03:26 UTC

Last updated: 10/13/2026, 18:57:33 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses