# CVE-2026-108385: dataclasses-avroschema code injection in enum generation

Source: https://junglewise.ai/threats/cve-2026-108385-dataclasses-avroschema-generates-avro-schemas-from-python  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-13. Updated: 2026-10-16  
License: CC BY 4.0 with a link back

CVE-2026-108385 · Severity: high · CVSS 8.8 · Published 2026-10-13

dataclasses-avroschema is a library that generates Python code from Avro schemas. Attackers can craft malicious schema files containing special characters in enum names that break out of generated code strings, allowing them to inject arbitrary Python code that executes when the module is imported. This could lead to data theft, system compromise, or denial of service.

Technologies: [Dataclasses-Avroschema](https://junglewise.ai/threats/technologies/dataclasses-avroschema). Vendors: [Dataclasses-Avroschema](https://junglewise.ai/threats/vendors/dataclasses-avroschema).

## Quick answers

**Is CVE-2026-108385 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-108385 being exploited in the wild.

**How severe is CVE-2026-108385?** High severity, with a CVSS score of 8.8, published 13 October 2026.

**Which products and versions are affected?** Dataclasses-Avroschema 0.38.0 through 0.70.5.

**Is there a fix for CVE-2026-108385?** Yes: fixed in 0.70.6. Until then: Do not process Avro schemas from untrusted sources until upgrading to version 0.70.6 or later. Restrict access to schema generators and validate schema sources before processing.</anigation>
<parameter name="timeline">[{"kind": "disclosed", "at": "2026-10-13"}, {"kind": "patched", "at": "2026-08-18"}] Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-108385 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-108385?** Check whether you run Dataclasses-Avroschema at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in 0.70.6

Do not process Avro schemas from untrusted sources until upgrading to version 0.70.6 or later. Restrict access to schema generators and validate schema sources before processing.</anigation>
<parameter name="timeline">[{"kind": "disclosed", "at": "2026-10-13"}, {"kind": "patched", "at": "2026-08-18"}]

## Technical details

The BaseGenerator.parse_enum and EnumRepresentation.render_symbols methods use enum symbols from untrusted schemas directly as generated enum member names without validating them as valid Python identifiers. Newlines, quotes, and punctuation in enum symbols can inject statements into the generated enum class body during code generation. Exploitation requires the generator to process a malicious schema, a realistic scenario when consuming schemas from registries.

## Affected products

- dataclasses-avroschema dataclasses-avroschema 0.38.0 through 0.70.5

## References

- [https://github.com/marcosschroh/dataclasses-avroschema/commit/429f3d705d2d04c0c65e2ef832daed5ff91318fc](https://github.com/marcosschroh/dataclasses-avroschema/commit/429f3d705d2d04c0c65e2ef832daed5ff91318fc)
- [https://github.com/marcosschroh/dataclasses-avroschema/releases/tag/0.70.6](https://github.com/marcosschroh/dataclasses-avroschema/releases/tag/0.70.6)

## Related threats

- [dataclasses-avroschema code injection in field documentation](https://junglewise.ai/threats/cve-2026-108380-dataclasses-avroschema-generates-avro-schemas-from-python)
- [dataclasses-avroschema code injection in generated Python code](https://junglewise.ai/threats/cve-2026-108377-dataclasses-avroschema-generates-avro-schemas-from-python)
- [dataclasses-avroschema code injection in generated model defaults](https://junglewise.ai/threats/cve-2026-108376-dataclasses-avroschema-generates-avro-schemas-from-python)
- [dataclasses-avroschema code injection in generated Python modules](https://junglewise.ai/threats/cve-2026-108375-dataclasses-avroschema-generates-avro-schemas-from-python)
