CVE-2026-54621

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.
Configurations

No configuration.

History

28 Jul 2026, 22:17

Type Values Removed Values Added
New CVE

Information

Published : 2026-07-28 22:17

Updated : 2026-07-30 20:02


NVD link : CVE-2026-54621

Mitre link : CVE-2026-54621

CVE.ORG link : CVE-2026-54621


JSON object : View

Products Affected

No product.

CWE
CWE-94

Improper Control of Generation of Code ('Code Injection')

CWE-1336

Improper Neutralization of Special Elements Used in a Template Engine