Code injection in dataclasses-avroschema Pydantic model generation
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-94.
Summary
The Pydantic and AvroDantic model generators in dataclasses-avroschema, from 0.44.0 through 0.70.5, insert a schema field's pydantic-class value after "pydantic." in a generated field annotation without safely restricting the expression. Annotations are evaluated when the generated module is imported, so a crafted value can execute arbitrary Python code (CWE-94). The CVSS 3.1 base score is 8.8 (HIGH).
Written with Claude Haiku 5.5 from the sources below · 2026-10-27
Description from the CNA
dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 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 safely restricting the expression. Because annotations are evaluated when the generated module is imported, a crafted value can execute arbitrary Python code. Version 0.70.6 fixes the vulnerability by restricting the value to a bare name or a call to a bare name with literal arguments.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| marcosschroh | dataclasses-avroschema | 0.44.0 to before 0.70.6 | 0.70.6 | Patch available | CNA |
- dataclasses-avroschema Vendormarcosschroh Affected 0.44.0 to before 0.70.6 Fixed in 0.70.6 Patch available CNA
Remediation
Upgrade dataclasses-avroschema to version 0.70.6, which restricts the pydantic-class value to a bare name or a call to a bare name with literal arguments.
Written with Claude Haiku 5.5 from the sources below · 2026-10-27
- Fix · CNA dataclasses-avroschema (marcosschroh) Fixed in 0.70.6
Timeline
- 2026-10-13 Threatist record created from CVE-2026-108381
- 2026-10-14 Priority changed: MEDIUM → LOW
- 2026-10-18 CISA SSVC decision points changed
- 2026-10-18 Priority changed: LOW → HIGH
References
Other 4
- https://github.com/marcosschroh/dataclasses-avroschema/security/advisories/GHSA-4jmx-9m83-vxx8
- https://github.com/marcosschroh/dataclasses-avroschema/pull/358
- https://github.com/marcosschroh/dataclasses-avroschema/commit/429f3d705d2d04c0c65e2ef832daed5ff91318fc
- https://github.com/marcosschroh/dataclasses-avroschema/releases/tag/0.70.6
More marcosschroh vulnerabilities
- TI-2026-71971 Code injection in dataclasses-avroschema enum generation CVSS 3.1HIGH 8.8
- TI-2026-71968 Code injection in dataclasses-avroschema through enum symbol literals CVSS 3.1HIGH 8.8
- TI-2026-71966 Code injection in dataclasses-avroschema Pydantic field documentation CVSS 3.1HIGH 8.8
- TI-2026-71964 Code injection in dataclasses-avroschema generated class docstrings CVSS 3.1HIGH 8.8
- TI-2026-71963 Code injection in dataclasses-avroschema through Meta.schema_name CVSS 3.1HIGH 8.8
- TI-2026-71962 Code injection in dataclasses-avroschema via Avro record names CVSS 3.1HIGH 8.8
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences