Impact
dataclasses-avroschema can generate Avro schemas from Python dataclasses and generate Python code from Avro schemas. Between versions 0.62.3 and 0.70.5 the rendered ClassRepresentation.render_metaclass inserts a schema-controlled Avro record name directly into the quoted Meta.schema_name field without escaping. A crafted name can therefore terminate the string literal and inject arbitrary statements into the generated class body. When the resulting module is imported, the injected code executes, giving the attacker full control over the process. The uncontrolled code runs with the same privileges as the importing application, potentially compromising confidentiality, integrity, or availability.
Affected Systems
Vendor Marcosschroh develops the dataclasses-avroschema library. All releases from 0.62.3 through 0.70.5 are vulnerable. Version 0.70.6 contains a fix that properly escapes schema values rendered into string literals. Any setup that depends on an unpatched version of the library and generates Avro schemas based on user supplied metadata is at risk.
Risk and Exploitability
The CVSS score of 8.8 denotes high severity. Because the vulnerability is exercised when the generated code is imported, an attacker can trigger it by providing a malicious schema name to any function that outputs a dialect or generates a schema representation. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, but its impact is significant for any environment that generates modules from untrusted input. Exploitation requires only the ability to influence the schema name; no additional privileges are needed beyond those of the importing process. Given the lack of an official workaround, timely patching is essential to mitigate this risk.
OpenCVE Enrichment