CVE-2026-55415
Received Received - Intake

Remote Code Execution in datamodel-code-generator via Malicious Schema

Vulnerability report for CVE-2026-55415, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-28

Last updated on: 2026-07-28

Assigner: GitHub, Inc.

Description

datamodel-code-generator generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON, YAML, or CSV. From 0.11.6 until 0.64.0, datamodel-code-generator allows attacker-controlled x-python-import or customTypePath schema extensions to reach src/datamodel_code_generator/parser/jsonschema.py and generated import handling through Import.from_full_path and Imports.create_line in src/datamodel_code_generator/imports.py, allowing a newline to break out of an import statement and execute Python code when the generated model is imported. This issue is fixed in version 0.64.0.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-28
Last Modified
2026-07-28
Generated
2026-07-29
AI Q&A
2026-07-29
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
datamodel-code-generator datamodel-code-generator to 0.64.0 (exc)
datamodel-code-generator datamodel-code-generator 0.64.0

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
CWE-95 The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval").

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

The vulnerability in datamodel-code-generator (versions 0.11.6 to 0.64.0) allows an attacker to inject malicious schema extensions like x-python-import or customTypePath. These extensions can manipulate the generated Python import statements, inserting newlines to break out of the intended import block. When the generated model is imported, this could execute arbitrary Python code on the system.

Detection Guidance

Check if your datamodel-code-generator version is between 0.11.6 and 0.64.0. Run: pip show datamodel-code-generator. If installed, verify the version and update to 0.64.0 or later to mitigate the risk.

Impact Analysis

If you use affected versions of datamodel-code-generator, an attacker could craft a malicious schema file that, when processed, generates code executing arbitrary commands on your system. This could lead to data theft, system compromise, or further network infiltration depending on the attacker's goals.

Compliance Impact

This vulnerability could lead to unauthorized code execution, potentially causing data breaches or loss of sensitive information. Such incidents may violate compliance requirements under GDPR (data protection), HIPAA (health data), or other regulations, resulting in legal penalties, reputational damage, and mandatory breach notifications.

Mitigation Strategies

Upgrade datamodel-code-generator to version 0.64.0 or later to address the vulnerability. Review any generated models for suspicious imports or code execution behavior.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-55415. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart