CVE-2026-108384

dataclasses-avroschema allows code injection through fixed-type aliases supplied as a bare string

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 interpolates a fixed type's aliases value directly into a generated types.confixed annotation. A list is represented with quoted entries, but a bare string is emitted as an unquoted Python expression and evaluated when the generated module is imported, allowing arbitrary code execution from a crafted schema. Version 0.70.6 fixes the vulnerability by rejecting aliases values that are not lists.

Analysis

AI-generated

Technical impact

The vulnerability lies in BaseGenerator.parse_fixed which interpolates the aliases value of a fixed-type field directly into a generated Avro schema module. If the aliases list contains a bare string, it is emitted as raw Python code and executed when the module is imported, allowing an attacker to run arbitrary code in the context of the importing process. This flaw is classified as CWE-94, an input that results in arbitrary code execution. The impact is the ability to execute malicious code on any system that imports a module produced from a malicious schema.

Affected Systems

This issue affects the Python library dataclasses‑avroschema from vendor marcosschroh. Versions 0.38.0 through 0.70.5 are vulnerable. The newest release, 0.70.6, removes the unsafe behavior by rejecting non‑list aliases.

Risk and Exploitability

The CVSS score of 8.8 indicates a high severity. No EPSS score is available, and it is not listed in the CISA KEV catalog, but the flaw remains exploitable. The attack can be staged by an attacker supplying a crafted Avro schema that contains a malicious bare string alias; the resulting generated Python module will execute that string when imported. Current data suggest this requires the attacker to either control the generation process or have the target include the generated module in its code base. Thus, the exploit is feasible in scenarios where untrusted schemas are processed and the generated module is imported.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to dataclasses-avroschema 0.70.6 or later to reject malicious aliases and eliminate the code injection vulnerability.
  • If an upgrade is not immediately possible, do not import generated modules from untrusted schemas; validate or whitelist schema sources before generation.
  • Isolate the code generation and import process by running it in a restricted environment or using code signing to prevent execution of untrusted generated code.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Marcosschroh
Marcosschroh dataclasses-avroschema
Vendors & Products Marcosschroh
Marcosschroh dataclasses-avroschema
Type Values Removed Values Added
Metrics ssvc

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

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 interpolates a fixed type's aliases value directly into a generated types.confixed annotation. A list is represented with quoted entries, but a bare string is emitted as an unquoted Python expression and evaluated when the generated module is imported, allowing arbitrary code execution from a crafted schema. Version 0.70.6 fixes the vulnerability by rejecting aliases values that are not lists.
Title dataclasses-avroschema allows code injection through fixed-type aliases supplied as a bare string
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