CVE-2026-108379

dataclasses-avroschema fixed namespaces allow code injection in generated annotations

Published Oct 13, 2026 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

BaseGenerator.parse_fixed in dataclasses-avroschema inserts a fixed type's namespace value directly into a generated types.confixed annotation without escaping. A crafted quote breaks out of the string and alters the surrounding Python annotation expression, which Python evaluates when the class is defined. The resulting effect is arbitrary code execution during import or runtime of the generated class. This is a classic code injection flaw (CWE‑94).

Affected Systems

The library marcosschroh dataclasses-avroschema is affected for all releases from version 0.38.0 through 0.70.5 inclusive. In these versions the BaseGenerator.parse_fixed function processes namespace strings unsafely. The issue is resolved in 0.70.6, which enforces that namespaces consist of a dot‑separated sequence of valid Avro names.

Risk and Exploitability

The CVSS score of 8.8 indicates high severity. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector requires an attacker to supply a crafted Avro schema file with a malicious namespace string; when the library generates Python code from that schema, the unsafe injection is executed. This can happen in any environment where the library processes external schemas, making the risk significant for systems that rely on dynamic schema generation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to dataclasses-avroschema version 0.70.6 or later, which enforces Avro naming rules for namespaces.
  • If an upgrade is not immediately possible, validate or sanitize any namespace values before they are passed to the library: only allow letters, digits, underscores and dot separators, and escape any quote characters.
  • Avoid generating Python code from untrusted Avro schemas; generate code offline, review it manually, and restrict access to the schema source to trusted developers.

Generated by OpenCVE AI on October 13, 2026 at 19:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Marcosschroh
Marcosschroh dataclasses-avroschema
Vendors & Products Marcosschroh
Marcosschroh dataclasses-avroschema
Type Values Removed Values Added
Description 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.
Title dataclasses-avroschema fixed namespaces allow code injection in generated annotations
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 13, 2026, 8:21 PM
Reserved
Oct 9, 2026, 9:36 PM
Status
Deferred
Published
Oct 13, 2026, 6:17 PM
Modified
Oct 16, 2026, 8:04 PM