CVE-2026-108380

dataclasses-avroschema field documentation allows code injection in generated Pydantic descriptions

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

Analysis

AI-generated

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

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 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.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'}

Weaknesses
  • CWE-94

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 13, 2026, 6:17 PM
Reserved
Oct 9, 2026, 9:36 PM
Status
Deferred
Published
Oct 13, 2026, 6:17 PM
Modified
Oct 16, 2026, 8:04 PM