Skip to main content
EPSS 0.1%top 96%

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

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

Description

A code injection vulnerability exists in koxudaxi datamodel-code-generator versions 0.51.0 through before 0.60.2. The issue arises because attacker-controlled JSON Schema content can inject Python code into generated field annotations without sufficient validation, leading to code execution when the generated module is imported. This vulnerability is fixed in version 0.60.2.

CVSS v3.1

Score 7.8high

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

Affected software

koxudaxi

datamodel-code-generator

Affected versions
>=0.51.0 <0.60.2

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/05/2026, 15:17:54 UTC

Technical Analysis

The datamodel-code-generator tool generates Python data models from schema definitions. Between versions 0.51.0 and before 0.60.2, the x-python-type values parsed by the _get_python_type_override function in src/datamodel_code_generator/parser/jsonschema.py are inserted directly into generated field annotations without adequate validation. This allows an attacker who controls JSON Schema input to inject and execute arbitrary Python code upon import of the generated module. The vulnerability is identified as CWE-94 (Improper Control of Generation of Code).

Potential Impact

Successful exploitation allows an attacker with the ability to supply JSON Schema input to execute arbitrary Python code in the context of the user importing the generated module. This can lead to full compromise of the environment where the code is run, including confidentiality, integrity, and availability impacts. The CVSS v3.1 base score is 7.8 (High), reflecting local attack vector, low complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability.

Mitigation Recommendations

Upgrade datamodel-code-generator to version 0.60.2 or later, where this vulnerability is fixed. No other official remediation or temporary fixes are documented. Until upgrading, avoid importing generated modules from untrusted or attacker-controlled JSON Schema inputs.

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-15T20:16:46.199Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6a6924a99c2644c7f8425668

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

Last enriched: 08/05/2026, 15:17:54 UTC

Last updated: 09/12/2026, 22:01:34 UTC

Views: 43

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