IT SBIT Services
Schneeberger
DEEN
CVE tracker

dataclasses-avroschema: Code injection in generated Pydantic models

CVE-2026-108380High 8.8

← All vulnerabilities

Summary

dataclasses-avroschema generates Python code from Avro schemas and Python models. A schema field's doc value is inserted into a generated pydantic.Field description without escaping, so a crafted quote can end the string and inject Python expressions. The injected code runs when the generated class definition is evaluated, which affects Pydantic and AvroDantic model generation.

Affected

  • dataclasses-avroschema from 0.65.9 through 0.70.5 (CNA record: >= 0.65.9, < 0.70.6)
  • Affected model types: pydantic and avrodantic

Fixed in

  • Version 0.70.6 (escapes the documentation value before rendering it)

Workaround

Unknown. The vendor advisory does not document a workaround.

Exploitation

  • CISA SSVC lists exploitation as 'poc' (proof of concept) and automatable as 'no'.
  • Public exploit availability is reported inconsistently: some trackers report no public PoC or exploit.
  • No evidence of exploitation in the wild found.

Our recommendation

  • Check for the package with 'pip show dataclasses-avroschema' and in requirements or lock files.
  • Upgrade to version 0.70.6 or later.
  • Until the upgrade is done, generate code only from trusted schemas and do not import generated modules from untrusted sources.
  • Review doc fields in schemas received from external parties.

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

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

NVD references (5)

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.