Description
dataclasses-avroschema generates Avro schemas from Python dataclasses, Pydantic models, and Faust Records and generates Python code from Avro schemas. From version 0.65.9 through 0.70.5, PydanticFieldRepresentation.add_field_properties inserts a schema field's doc value between the quotes of a generated pydantic.Field description argument without escaping it. A crafted quote can terminate the string and inject an expression evaluated during generated class definition, allowing arbitrary Python code execution for Pydantic and AvroDantic model generation. Version 0.70.6 fixes the vulnerability by escaping the documentation value before rendering it.
Published: 2026-10-13
Score: 8.8 High
EPSS: n/a
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

A crafted field documentation entry in dataclasses-avroschema can terminate the string that it inserts into the Pydantic Field description, allowing the attacker to inject arbitrary Python code that is executed at import time. The vulnerability is a classic code‑execution flaw (CWE‑94) that permits the execution of user‑controlled bytecode during automatic model generation. If an attacker supplies a malicious data class that is processed by a vulnerable instance, they can run arbitrary code within the Python process that generates the model, leading to complete compromise of that process.

Affected Systems

The flaw affects the dataclasses‑avroschema package distributed under the marcosschroh vendor. Versions from 0.65.9 through 0.70.5 are vulnerable. All installations that rely on automatic Avro schema generation and Pydantic model creation using these versions are impacted.

Risk and Exploitability

The CVSS score of 8.8 classifies this as a high‑severity vulnerability, indicating a high likelihood of exploitable conditions if the code is executed in an environment where the package is used to generate schemas from untrusted input. The EPSS score is not available, but the lack of a KEV listing suggests there are no confirmed widespread exploitation campaigns yet. The attack vector is inferred to be code injection via crafted field documentation; an adversary can supply a malicious data class definition or schema that, when processed, results in the injection of executable expressions within the generated Pydantic or AvroDantic model code.

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

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade dataclasses‑avroschema to version 0.70.6 or later to apply the fix that escapes documentation values before rendering.
  • If upgrading immediately is not possible, avoid processing untrusted data classes by restricting inputs to a whitelist or sanitizing documentation strings prior to schema generation.
  • Regularly review the package repository for new releases and monitor security advisories to ensure that any future patches are applied promptly.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 13 Oct 2026 19: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 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.65.9 through 0.70.5, PydanticFieldRepresentation.add_field_properties inserts a schema field's doc value between the quotes of a generated pydantic.Field description argument without escaping it. A crafted quote can terminate the string and inject an expression evaluated during generated class definition, allowing arbitrary Python code execution for Pydantic and AvroDantic model generation. Version 0.70.6 fixes the vulnerability by escaping the documentation value before rendering it.
Title dataclasses-avroschema field documentation allows code injection in generated Pydantic descriptions
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-13T18:17:04.630Z

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

Link: CVE-2026-108380

cve-icon Vulnrichment

Updated: 2026-10-13T18:16:58.675Z

cve-icon NVD

Status : Received

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

Modified: 2026-10-13T19:18:04.567

Link: CVE-2026-108380

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-13T20:00:16Z

Weaknesses
  • CWE-94

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