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.
Published: 2026-10-13
Score: 8.8 High
EPSS: n/a
KEV: No
Impact: Arbitrary code execution
Action: Immediate Patch
AI Analysis

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.

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

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 yet.

History

Tue, 13 Oct 2026 18:00:00 +0000

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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-13T20:21:27.845Z

Reserved: 2026-10-09T21:36:27.043Z

Link: CVE-2026-108379

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-13T18:17:17.000

Modified: 2026-10-13T18:17:17.000

Link: CVE-2026-108379

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-13T19:30:12Z

Weaknesses
  • CWE-94

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