dataclasses-avroschema: Code injection via unescaped record docstrings
Summary
dataclasses-avroschema generates Python code from Avro schemas. In versions 0.40.0 through 0.70.5, the doc value of a schema record is copied unescaped into a generated class docstring. A crafted schema can close the docstring and inject Python statements, which run when the generated module is imported.
Affected
- dataclasses-avroschema (PyPI) from 0.40.0 through 0.70.5 (CNA range: >= 0.40.0, < 0.70.6)
Fixed in
- Fixed in 0.70.6 and later. The fix escapes quotes, backslashes and unsafe control characters in docstrings.
Workaround
- Unknown. No vendor workaround is documented.
- Do not generate or import Python code from Avro schemas of untrusted parties.
- Restrict who can publish schemas to the schema registry.
- Review schema doc fields before code generation.
Exploitation
- No evidence of exploitation in the wild or public proof of concept found at the time of research.
- CISA SSVC: exploitation status 'poc', automatable: no, technical impact: total.
Our recommendation
- Inventory Python projects that use dataclasses-avroschema and check the installed version.
- Upgrade to 0.70.6 or newer; this also covers related code-generation issues in the same release line.
- Prioritise pipelines that ingest external or partner-supplied Avro schemas.
- Run code generation in isolated CI jobs rather than on production hosts.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- GitHub Security Advisory GHSA-ff3j-hw44-6vx4 github.com
- Release 0.70.6 github.com
- Fix commit 429f3d7 github.com
- OSV: CVE-2026-108378 osv.dev
- EUVD-2026-98964 vulners.com
- Strix CVE-2026-108378 www.strix.ai
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 19:46.
Original description (NVD)
dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.40.0 through 0.70.5, ClassRepresentation.render_docstring copies a schema record's doc value into a generated triple-double-quoted class docstring without escaping quotes or backslashes. A crafted triple-quote sequence can close the docstring and inject statements into the generated class body, while a trailing backslash can escape the generated closing delimiter, allowing Python code execution during module import. Version 0.70.6 fixes the vulnerability by escaping quotes, backslashes, and unsafe control characters before rendering docstrings.
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
