CVE-2026-108376: dataclasses-avroschema enum field defaults can inject statements into generated modules

Published Oct 13, 2026
·
Updated

dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.38.0 through 0.70.5, FieldRepresentation.getfielddefault renders a schema-controlled enum field default as an enum member reference after applying case conversion but without validating it as an identifier. Newlines, operators, and punctuation can escape the intended reference and inject constrained statements into the generated module, allowing namespace modification or preventing the module from loading. Version 0.70.6 fixes the vulnerability by validating enum defaults as names.

Other sources

dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.47.3 through 0.70.5, FieldRepresentation.getfielddefault inserts a schema-controlled referenced record name into the callable position of a generated defaultfactory lambda without validating it as an Avro name. A crafted record name can become an arbitrary Python expression that executes when an instance of the generated model consumes the field default. Version 0.70.6 fixes the vulnerability by rejecting record names that do not match the Avro name grammar.

— NVD

Affected Software

1 affected component
pypi/dataclasses-avroschema>=0.38.0<=0.70.5, >=0.47.3<=0.70.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade dataclasses-avroschema to a version that resolves this vulnerability.

    Fixed in 0.70.6

Event History

Oct 13, 2026
CVE Published
via MITRE·05:17 PM
Data Sourced
via MITRE·05:17 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using dataclasses-avroschema versions 0.38.0 through 0.70.5 are affected when they generate Python code from an Avro schema containing a schema-controlled enum field default. The issue is in generated modules, not merely in schema generation.

2

What does an attacker need to exploit it?

An attacker needs to control, or cause the application to process, an Avro schema with a crafted enum field default. The crafted default must reach Python code generation; no authentication is required according to the supplied vector, but user interaction is required.

3

What is the impact of a successful exploit?

A crafted enum default can escape the intended enum-member reference and inject constrained statements into the generated Python module. This can modify the module namespace or cause the generated module to fail to load.

4

What should teams do if they cannot upgrade immediately?

Do not generate Python code from untrusted Avro schemas, and reject enum defaults that are not valid identifiers before code generation. Upgrading to version 0.70.6 is the documented fix.

5

How can teams identify potentially affected generated code?

Review generated Python modules produced from schemas with enum field defaults, especially where schemas originate from external or untrusted sources. Look for enum default values containing newlines, operators, or punctuation that would not be valid identifier names.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203