Skip to main content
EPSS 0.4%top 65%

CVE-2026-55415: CWE-94: Improper Control of Generation of Code ('Code Injection') in koxudaxi datamodel-code-generator

0
High
VulnerabilityCVE-2026-55415cvecve-2026-55415cwe-94cwe-95
Published: 07/28/2026 (07/28/2026, 21:37:55 UTC)
Source: CVE Database V5
Vendor/Project: koxudaxi
Product: datamodel-code-generator

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

Score 7.5high

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

koxudaxi

datamodel-code-generator

Affected versions
>=0.11.6 <0.64.0

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/29/2026, 23:36:59 UTC

Technical Analysis

The datamodel-code-generator tool, used to generate Pydantic v2 models and other data structures from various schema formats, improperly controls code generation when processing x-python-import or customTypePath schema extensions. Specifically, from versions 0.11.6 until 0.64.0, these extensions can inject newline characters that break out of import statements in the generated Python code, enabling execution of arbitrary code upon import. This is a CWE-94 (Improper Control of Generation of Code) vulnerability that can lead to high impact including confidentiality, integrity, and availability compromise. The issue is resolved in version 0.64.0.

Potential Impact

Successful exploitation allows an attacker to execute arbitrary Python code in the context of the environment importing the generated model, potentially leading to full system compromise. The vulnerability affects confidentiality, integrity, and availability of the affected system. The CVSS v3.1 score is 7.5 (High), reflecting network attack vector, high impact, but requiring user interaction and high attack complexity.

Mitigation Recommendations

Upgrade datamodel-code-generator to version 0.64.0 or later, where this vulnerability is fixed. No other official remediation or temporary fixes are documented. Until upgrading, avoid importing generated models from untrusted schema sources that could contain malicious x-python-import or customTypePath extensions.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-06-16T21:48:43.125Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6a6924a99c2644c7f842568b

Added to database: 07/28/2026, 21:52:41 UTC

Last enriched: 07/29/2026, 23:36:59 UTC

Last updated: 09/10/2026, 20:00:53 UTC

Views: 81

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses