IT SBIT Services
Schneeberger
DEEN
CVE tracker

dataclasses-avroschema: Code injection via namespace in generated annotations

CVE-2026-108379High 8.8

← All vulnerabilities

Summary

dataclasses-avroschema is an open-source Python library that generates Avro schemas from Python classes and Python code from Avro schemas. In versions 0.38.0 through 0.70.5, the namespace of a fixed type is inserted unescaped into a generated annotation. A crafted schema can break out of the string and inject Python code, which runs when the generated class is defined, so an attacker can execute arbitrary code on the machine that imports the generated module. The attack requires that a user generates code from a malicious schema and imports it, as indicated by the user interaction requirement (UI:R).

Affected

  • marcosschroh dataclasses-avroschema, versions 0.38.0 through 0.70.5 (OSV and CVE record: >= 0.38.0, < 0.70.6)

Fixed in

  • Version 0.70.6 (namespaces must now be a dot-separated sequence of valid Avro names)
  • A later release (0.70.9 is listed as current on Socket) exists; verify on PyPI before pinning

Workaround

  • Unknown. No vendor-documented workaround found; upgrading is the only vendor-supported fix.
  • Until upgraded: do not generate code from untrusted or third-party Avro schemas, review namespace values before generation, and run generation in an isolated environment.

Exploitation

  • No evidence of exploitation in the wild found.
  • No public proof of concept found; no CISA KEV entry found.
  • EPSS score 0.00343 (EUVD record).
  • CISA SSVC: exploitation none, automatable no, technical impact total.

Our recommendation

  • Check whether any project uses dataclasses-avroschema in the affected range (for example with pip show or a lock file).
  • Upgrade to version 0.70.6 or later, preferably the current release.
  • Only generate code from trusted schemas, for example from your own schema registry, and do not import generated modules from untrusted origins.
  • Run code generation in CI or isolated environments rather than on developer workstations with sensitive access.

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:41.

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.38.0 through 0.70.5, BaseGenerator.parse_fixed inserts a fixed type's namespace value between quotes inside a generated types.confixed annotation without escaping or validating it. A crafted quote can terminate the namespace string and alter the surrounding annotation expression, which Python evaluates when the generated class is defined, allowing arbitrary code execution. Version 0.70.6 fixes the vulnerability by requiring the namespace to be a dot-separated sequence of valid Avro names.

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.