Impact
The flaw is in how the dataclasses‑avroschema library renders the documentation string of Avro schema records into a generated Python class docstring. The rendering routine copies the document value directly into a triple‑quoted string without escaping quote characters or backslashes. A malicious schema can include a closing triple‑quote sequence followed by Python statements, or a trailing backslash that prevents the generated closing delimiter from terminating the string. When the generated module is imported, the injected code is executed in the importing process’s context, giving the attacker arbitrary code execution. This is a classic instance of code injection via improper input escaping (CWE‑94).
Affected Systems
The Python library dataclasses‑avroschema, maintained by marcosschroh, is affected. All releases from 0.40.0 through 0.70.5 contain the issue. The vulnerability is remedied in version 0.70.6 and later.
Risk and Exploitability
The CVSS base score of 8.8 signals high severity. No EPSS score is available and the flaw is not listed in the CISA KEV catalog, indicating there is no public evidence of exploitation. Attackers must supply a crafted Avro schema that a trusted application processes to generate Python code. Once that generated module is imported, the embedded code runs with the authority of the importing process. Consequently, the vulnerability presents a local code‑execution risk, especially in environments that accept untrusted schemas or import generated modules without additional validation.
OpenCVE Enrichment