CVE-2026-108379 in dataclasses-avroschemainfo

Summary

by MITRE • 10/13/2026

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, BaseGenerator.parse_fixed inserts a fixed type's namespace value between quotes inside a generated types.confixed annotation without escaping or validating it. A crafted quote can terminate the namespace string and alter the surrounding annotation expression, which Python evaluates when the generated class is defined, allowing arbitrary code execution. Version 0.70.6 fixes the vulnerability by requiring the namespace to be a dot-separated sequence of valid Avro names.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 10/13/2026

The dataclasses-avroschema library serves as a critical utility for developers working with Apache Avro serialization formats in Python environments, facilitating the generation of schema definitions from Pythonic structures such as dataclasses and Pydantic models while also enabling code generation from existing schemas. A significant security vulnerability was identified within versions 0.38.0 through 0.70.5 affecting the BaseGenerator.parse_fixed method responsible for handling Avro fixed types. This flaw stems from an improper neutralization of special elements during string preparation, specifically regarding how namespace values are processed when generating Python code annotations. When a user provides input containing unescaped quotation marks within the namespace field, the generator fails to validate or escape these characters before embedding them into the generated source code structure.

This lack of input validation allows an attacker who controls the schema definition or triggers the generation process with maliciously crafted data to inject arbitrary Python expressions directly into the class body via a types.confixed annotation. Because Python evaluates annotations at runtime when classes are defined, this injection results in immediate execution of the injected payload within the context of the application running the code generator. This mechanism effectively constitutes an Insecure Deserialization vulnerability where untrusted schema definitions lead to Remote Code Execution, bypassing standard security controls by exploiting the dynamic nature of Python's class definition process and annotation evaluation features.

The operational impact of this flaw is severe, as it allows for complete compromise of the host system executing the code generation logic. An attacker can achieve arbitrary command execution, data exfiltration, or further lateral movement within the network depending on the privileges held by the application running the vulnerable library version. This risk is particularly acute in environments where Avro schemas are generated dynamically from user-supplied input or when integrating with external systems that provide schema definitions without rigorous validation. The vulnerability aligns with CWE-94 Improper Control of Generation of Code, often referred to as code injection, and maps to the ATT&CK technique T1059 Command and Scripting Interpreter under Execution tactics, highlighting its potential for abuse in automated pipelines or API endpoints that process schema definitions.

Mitigation strategies require immediate upgrading to version 0.70.6 or later of dataclasses-avroschema, which addresses this issue by enforcing strict validation rules on namespace values. The patched implementation requires namespaces to be valid dot-separated sequences of Avro names, thereby preventing the injection of special characters such as quotes that could terminate strings and alter code structure. For organizations unable to upgrade immediately due to dependency constraints, implementing a robust input validation layer at the application boundary is essential. This involves sanitizing all namespace fields before they are passed to the schema generation functions, ensuring that only alphanumeric characters and dots are permitted in these specific string parameters. Additionally, developers should review any automated pipelines or services that generate Python code from Avro schemas to ensure no untrusted data sources can influence the generated output without proper escaping or validation mechanisms in place.

Responsible

GitHub M

Reservation

10/09/2026

Disclosure

10/13/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!