IT SBIT Services
Schneeberger
DEEN
CVE tracker

dataclasses-avroschema: Code injection via unescaped record docstrings

CVE-2026-108378High 8.8

← All vulnerabilities

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

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.

NVD references (3)

Sources

The tracker combines official, freely usable data sources – updated continuously:

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.