Code Injection Vulnerability in datamodel-code-generator by Koxudaxi
CVE-2026-54654

7.8HIGH

Key Information:

Vendor

Koxudaxi

Vendor
CVE Published:
28 July 2026

What is CVE-2026-54654?

The datamodel-code-generator tool, which converts schema definitions into Python data models, contains a vulnerability affecting versions 0.14.1 to 0.60.2. The issue arises from the --extra-template-data comment field being rendered into Python comments without properly neutralizing carriage returns. This flaw can be exploited by an attacker who controls the input comment value, leading to potential execution of arbitrary Python code within the generated models upon import. The vulnerability has been addressed in version 0.60.2.

Affected Version(s)

datamodel-code-generator >= 0.14.1, < 0.60.2

References

CVSS V3.1

Score:
7.8
Severity:
HIGH
Confidentiality:
High
Integrity:
High
Availability:
High
Attack Vector:
Local
Attack Complexity:
Low
Privileges Required:
None
User Interaction:
Required
Scope:
Unchanged

Timeline

  • Vulnerability published

  • Vulnerability Reserved

.