RCE in Koxudaxi Datamodel-Code-Generator

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.

Vulnerability class: RCE (Remote Code Execution)

EPSS: 0.001 (3.8th percentile) — read the EPSS interpretation.

CVSS v3 metric

CVSS v3 base score 7.8 (High). Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.

Affected products

Weakness classification (CWE)

References

Frequently asked questions

What is CVE-2026-54621?
CVE-2026-54621 is a high-severity vulnerability in Koxudaxi Datamodel-Code-Generator, classified under Code Injection. CVSS score: 7.8/10. Published 2026-07-28.
How severe is CVE-2026-54621?
High severity. CVSS v3 base score is 7.8 out of 10.