# CVE-2026-108382: dataclasses-avroschema code injection in enum symbol rendering

Source: https://junglewise.ai/threats/cve-2026-108382-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-108382 · Severity: high · CVSS 8.8 · Published 2026-10-13

dataclasses-avroschema is a Python library that generates Avro schemas and Python code from data models. Versions 0.38.0 through 0.70.5 contain a code injection vulnerability where untrusted enum symbols from Avro schemas can break out of string literals and execute arbitrary Python code when the generated module is imported. An attacker who controls an Avro schema could achieve code execution on systems that generate Python code from that schema.

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

## Quick answers

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

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

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

**Is there a fix for CVE-2026-108382?** Yes: fixed in 0.70.6. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

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

**Am I affected by CVE-2026-108382?** Check whether you run Marcosschroh 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

## Technical details

The EnumRepresentation.render_symbols method concatenates schema-controlled enum symbol values directly between double quotes without escaping, allowing a quote character in an enum symbol to terminate the string literal and inject arbitrary Python code into the generated enum class body. When the generator classes are used directly to consume untrusted schemas, this code executes at module import time. The vulnerability also affects other schema values including record namespaces, docs, defaults, and field descriptions. Version 0.70.6 fixes this by escaping values with json.dumps and validating names in identifier positions.

## Affected products

- marcosschroh dataclasses-avroschema 0.38.0 through 0.70.5

## Timeline

- 2026-10-13: disclosed
- 2026-08-18: patched: Fix commit and release 0.70.6 published

## 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 schema parsing](https://junglewise.ai/threats/cve-2026-108384-dataclasses-avroschema-generates-avro-schemas-from-python)
- [dataclasses-avroschema code injection in generated annotations](https://junglewise.ai/threats/cve-2026-108381-dataclasses-avroschema-generates-avro-schemas-from-python)
- [dataclasses-avroschema code injection in docstring rendering](https://junglewise.ai/threats/cve-2026-108378-dataclasses-avroschema-generates-avro-schemas-from-python)
