CVE-2026-54621
Published:July 28, 2026
Updated:August 04, 2026
datamodel-code-generator generates Python data models from schema definitions. Prior to 0.60.1, GraphQL Union description values in src/datamodel_code_generator/model/template/UnionTypeStatement.jinja2 and src/datamodel_code_generator/model/template/UnionTypeStatement.py312.jinja2 are rendered into Python comments without neutralizing carriage returns in Python # comments, allowing attacker-controlled GraphQL schema content to inject Python code into generated models that runs when imported. This issue is fixed in version 0.60.1.
Affected Packages
datamodel-code-generator (CONDA):
Affected version(s) >=0.25.0 <0.60.1Fix Suggestion:
Update to version 0.60.1https://github.com/koxudaxi/datamodel-code-generator.git (GITHUB):
Affected version(s) >=0.25.0 <0.60.1Fix Suggestion:
Update to version 0.60.1datamodel-code-generator (PYTHON):
Affected version(s) >=0.25.0 <0.60.1Fix Suggestion:
Update to version 0.60.1Related Resources (8)
Do you need more information?
Contact UsCVSS v4
Base Score:
8.5
Attack Vector
LOCAL
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
PASSIVE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.8
Attack Vector
LOCAL
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Weakness Type (CWE)
EPSS
Base Score:
0.14