CVE-2026-108378: dataclasses-avroschema record documentation can terminate generated class docstrings

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.40.0 through 0.70.5, ClassRepresentation.renderdocstring copies a schema record's doc value into a generated triple-double-quoted class docstring without escaping quotes or backslashes. A crafted triple-quote sequence can close the docstring and inject statements into the generated class body, while a trailing backslash can escape the generated closing delimiter, allowing Python code execution during module import. Version 0.70.6 fixes the vulnerability by escaping quotes, backslashes, and unsafe control characters before rendering docstrings.

Affected Software

1 affected component
pypi/dataclasses-avroschema>=0.40.0<=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:34 PM
Data Sourced
via MITRE·05:34 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Users of dataclasses-avroschema versions 0.40.0 through 0.70.5 are exposed when they generate Python code from Avro schemas containing record-level doc values and later import the generated module. The risk is especially relevant where schemas can be supplied or modified by untrusted parties.

2

What does an attacker need to exploit it?

An attacker needs to place a crafted value in an Avro schema record's doc field. The generated Python code must then be imported, at which point injected statements in the generated class body can execute.

3

Is user interaction required?

Yes. The supplied vector indicates user interaction is required, and the described execution occurs when someone imports a module generated from the crafted schema.

4

What should teams do if they cannot upgrade immediately?

Do not generate and import Python modules from untrusted Avro schemas, particularly schemas with record doc fields. Review generated code before importing it and avoid processing crafted documentation values containing triple quotes or trailing backslashes.

5

How can I determine whether I may be affected?

Check whether your installed dataclasses-avroschema version falls between 0.40.0 and 0.70.5 and whether your workflow generates Python code from Avro schemas. Inspect record doc values and already-generated Python modules for unexpected statements near generated class docstrings.

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