Skip to main content
EPSS 0.1%top 96%

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

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

Description

CVE-2026-54621 is a high-severity code injection vulnerability in koxudaxi's datamodel-code-generator prior to version 0.60.1. The vulnerability arises because GraphQL Union description values are rendered into Python comments without neutralizing carriage returns, allowing attacker-controlled schema content to inject executable Python code into generated models. This malicious code executes when the generated models are imported. The issue is fixed in version 0.60.1.

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

Affected versions
<0.60.1

AI-Powered Analysis

Machine-generated threat intelligence

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

Technical Analysis

The datamodel-code-generator tool generates Python data models from schema definitions. In versions before 0.60.1, the rendering of GraphQL Union description values into Python comments in specific template files does not neutralize carriage returns. This flaw enables an attacker to craft GraphQL schema content that injects Python code into the generated models. When these models are imported, the injected code executes, leading to potential full compromise of confidentiality, integrity, and availability. The vulnerability is tracked as CWE-94 (Improper Control of Generation of Code) and CWE-1336, with a CVSS v3.1 score of 7.8 (high severity).

Potential Impact

Successful exploitation allows an attacker with the ability to supply GraphQL schema content to inject and execute arbitrary Python code within the generated data models. This can lead to complete compromise of the affected system's confidentiality, integrity, and availability. The vulnerability requires local access to the code generation process (AV:L) and user interaction (UI:R) but does not require privileges (PR:N).

Mitigation Recommendations

This vulnerability is fixed in datamodel-code-generator version 0.60.1. Users should upgrade to version 0.60.1 or later to remediate this issue. No other official remediation or temporary fixes are documented. Until upgrading, avoid importing generated models from untrusted GraphQL schemas.

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:07:02.184Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6a6924a99c2644c7f842565e

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

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

Last updated: 09/10/2026, 19:36:54 UTC

Views: 47

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