CVE-2026-108380 Details
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.
A vulnerability in dataclasses-avroschema versions 0.65.9 through 0.70.5 allows for arbitrary code execution when generating models with Pydantic or AvroDantic. The issue arises because the 'doc' field in the schema is inserted into the generated Python code without proper escaping, creating an opportunity for code injection. This injected code is executed when the module is imported. The vulnerability has been patched in version 0.70.6 by escaping the 'doc' value before it is rendered.
Users should update to dataclasses-avroschema version 0.70.6 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Oct 13, 2026CISA-ADP
Assessed Oct 13, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/marcosschroh/dataclasses-avroschema/security/advisories/GHSA-g7p7-mgvm-jw7p | CISA-ADP | AdvisoryExploitRemedyVendor |
| https://github.com/marcosschroh/dataclasses-avroschema/commit/429f3d705d2d04c0c65e2ef832daed5ff91318fc | [email protected] | Source CodeVendor |
| https://github.com/marcosschroh/dataclasses-avroschema/pull/843 | [email protected] | Issue TrackingVendor |
| https://github.com/marcosschroh/dataclasses-avroschema/releases/tag/0.70.6 | [email protected] | Release NotesVendor |
| https://github.com/marcosschroh/dataclasses-avroschema/security/advisories/GHSA-g7p7-mgvm-jw7p | [email protected] | AdvisoryExploitRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| dataclasses-avroschema | <= 0.70.5 (semver) |
CPE
Remediation
| |
Change History
2 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 13, 2026 | CVE Modified | CISA-ADP |
| Oct 13, 2026 | New CVE Received | [email protected] |
Volerion