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

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.

Generated by OpenCVE AI on October 13, 2026 at 18:56 UTC.

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

History

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

Type Values Removed Values Added
Metrics ssvc

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


Tue, 13 Oct 2026 17:45: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 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

Tue, 13 Oct 2026 17:30: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 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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-13T17:27:01.914Z

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

Link: CVE-2026-108375

cve-icon Vulnrichment

Updated: 2026-10-13T17:26:56.956Z

cve-icon NVD

Status : Received

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

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

Link: CVE-2026-108375

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-13T19:00:06Z

Weaknesses
  • CWE-94

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