CVE-2026-108381 dataclasses-avroschema pydantic-class metadata allows code injection in generated annotations

High 8.8 Published Updated

Attackers can execute arbitrary Python code via crafted pydantic-class metadata in dataclasses-avroschema generated annotations.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2026-108381?

CVE-2026-108381 is a high-severity code injection vulnerability in marcosschroh dataclasses-avroschema, published on 13 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-94

Which versions are affected by CVE-2026-108381?

How do I fix CVE-2026-108381?

No fix has been published for CVE-2026-108381 yet. Limit exposure of the affected software until one is available.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-108381 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-108381 exists.

Sources

Also known as GHSA-4jmx-9m83-vxx8.

Is CVE-2026-108381 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free