CVE-2026-108375

dataclasses-avroschema allows code injection through generated field-default literals

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, FieldRepresentation.get_field_default inserts schema-controlled string, UUID, bytes, and fixed field defaults into quoted literals in generated Python source without escaping them. A crafted default can terminate the literal and inject statements into the generated module, which execute when the module is imported. Version 0.70.6 fixes the vulnerability by escaping schema values rendered into generated string literals.

Analysis

AI-generated

Technical impact

The library generates Python source from Avro schemas, inserting default values into quoted literals without escaping them. A crafted default can close the literal early and inject arbitrary code, which runs when the module is imported. This flaw is a code‑injection vulnerability (CWE‑94) that can allow an attacker to execute arbitrary Python code within any process that imports the generated module.

Affected Systems

Python projects using the open‑source library dataclasses‑avroschema between versions 0.38.0 and 0.70.5, inclusive. The issue is fixed in 0.70.6 and later. Any environment that generates and imports schemas with these affected library versions is at risk.

Risk and Exploitability

The CVSS score of 8.8 indicates high severity. EPSS is not available, and the vulnerability is not listed in the CISA KEV catalog, but the flaw remains exploitable where a malicious schema is supplied. An attacker can embed malicious content in a default value; when the library processes the schema and a consuming application imports the generated module, the injected code executes with the application's privileges. The attack requires the malicious schema to be ingested but does not need a network exploit. The impact is full code execution, potentially compromising confidentiality, integrity, and availability of the affected system.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade dataclasses‑avroschema to version 0.70.6 or newer.
  • Validate or sanitize incoming Avro schemas to reject or escape unsafe default literals before code generation.
  • If upgrade cannot be performed immediately, import generated modules in a separate isolated environment or subprocess to limit the impact of any injected code.

Generated by OpenCVE AI on October 13, 2026 at 18:56 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': 'poc', '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. 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, FieldRepresentation.get_field_default inserts schema-controlled string, UUID, bytes, and fixed field defaults into quoted literals in generated Python source without escaping them. A crafted default can terminate the literal and inject statements into the generated module, which execute when the module is imported. Version 0.70.6 fixes the vulnerability by escaping schema values rendered into generated string literals.
Title dataclasses-avroschema allows code injection through fixed-type aliases supplied as a bare string dataclasses-avroschema allows code injection through generated field-default literals
References
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, 5:27 PM
Reserved
Oct 9, 2026, 9:36 PM
Status
Awaiting Analysis
Published
Oct 13, 2026, 6:17 PM
Modified
Oct 16, 2026, 4:00 PM