Code Injection Vulnerability in datamodel-code-generator from Koxudaxi
CVE-2026-54621
7.8HIGH
What is CVE-2026-54621?
The datamodel-code-generator tool, which translates schema definitions into Python data models, has a vulnerability that allows attacker-controlled GraphQL schema content to be leveraged for injecting Python code. Prior to version 0.60.1, issues in the rendering process meant that GraphQL Union description values were turned into Python comments without properly handling carriage returns, enabling code execution upon import of the generated models. This security flaw has been addressed in version 0.60.1, urging all users to upgrade.
Affected Version(s)
datamodel-code-generator >= 0.25.0, < 0.60.1
