Impact
The vulnerability arises in the dataclasses-avroschema tool, which generates Avro schemas from Python data definitions and also produces corresponding Python code. Between versions 0.44.0 and 0.70.5 the generator inserts a schema field’s pydantic-class value directly into a field annotation without sanitisation. When the generated module is imported, Python evaluates the annotation, allowing a crafted field value to execute arbitrary code. This flaw effectively permits remote code execution in any process that imports the generated module, compromising confidentiality, integrity, and availability of the target system.
Affected Systems
Affected products include the dataclasses-avroschema package maintained by marcosschroh on PyPI. Versions from 0.44.0 through 0.70.5 are impacted. The issue was resolved in release 0.70.6 and later revisions, which enforce that the pydantic-class value is either a bare name or a bare name call with literal arguments.
Risk and Exploitability
The CVSS score of 8.8 classifies this flaw as High severity. While no EPSS value is available, the lack of a KEV listing does not negate the risk. The attack vector is inferred to be local or from an untrusted schema source: an attacker who can supply a schema that will be compiled into Python code can trigger code execution when that code is imported. Once exploited, the attacker can run arbitrary commands with the privileges of the importing process. Defensive controls should focus on preventing untrusted schemas from being processed by the generator or sanitising metadata before code generation.
OpenCVE Enrichment