Description
dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.47.3 through 0.70.5, FieldRepresentation.get_field_default inserts a schema-controlled referenced record name into the callable position of a generated default_factory lambda without validating it as an Avro name. A crafted record name can become an arbitrary Python expression that executes when an instance of the generated model consumes the field default. Version 0.70.6 fixes the vulnerability by rejecting record names that do not match the Avro name grammar.
Published: 2026-10-13
Score: 8.8 High
EPSS: n/a
KEV: No
Impact: Arbitrary code execution via injection in generated default factories
Action: Immediate Patch
AI Analysis

Impact

A flaw in dataclasses-avroschema allows a crafted Avro record name to be injected as a Python expression in the lambda used for a field's default_factory. When the generated model creates an instance, this expression is evaluated, giving the attacker the ability to execute arbitrary code. The weakness is an input validation failure (CWE-94).

Affected Systems

The issue impacts the Python library marcosschroh:dataclasses-avroschema versions 0.47.3 through 0.70.5. Systems that use these releases to generate dataclasses, Pydantic models, or Faust records from Avro schemas are potentially affected.

Risk and Exploitability

The CVSS score of 8.8 indicates a high severity. While no EPSS score is available, the lack of a KEV listing does not diminish the potential for exploitation. The vulnerability can be triggered when an attacker supplies a malicious record name during schema creation, making it most relevant for applications that import or process external Avro schemas without validating record names. Given the high severity and the ability to execute code on model instantiation, the risk is substantial under the described conditions.

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

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the library to version 0.70.6 or later, which rejects invalid record names
  • Apply strict input validation to any Avro record names before passing them to dataclasses-avroschema
  • Avoid importing or generating schemas from untrusted sources; use safe sandboxing or content filtering

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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, FieldRepresentation.get_field_default renders a schema-controlled enum field default as an enum member reference after applying case conversion but without validating it as an identifier. Newlines, operators, and punctuation can escape the intended reference and inject constrained statements into the generated module, allowing namespace modification or preventing the module from loading. Version 0.70.6 fixes the vulnerability by validating enum defaults as names. dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.47.3 through 0.70.5, FieldRepresentation.get_field_default inserts a schema-controlled referenced record name into the callable position of a generated default_factory lambda without validating it as an Avro name. A crafted record name can become an arbitrary Python expression that executes when an instance of the generated model consumes the field default. Version 0.70.6 fixes the vulnerability by rejecting record names that do not match the Avro name grammar.
Title dataclasses-avroschema enum field defaults can inject statements into generated modules dataclasses-avroschema allows code injection through record names in generated default factories

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, FieldRepresentation.get_field_default renders a schema-controlled enum field default as an enum member reference after applying case conversion but without validating it as an identifier. Newlines, operators, and punctuation can escape the intended reference and inject constrained statements into the generated module, allowing namespace modification or preventing the module from loading. Version 0.70.6 fixes the vulnerability by validating enum defaults as names.
Title dataclasses-avroschema enum field defaults can inject statements into generated modules
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:24:09.441Z

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

Link: CVE-2026-108376

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

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

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

Link: CVE-2026-108376

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