CVE-2026-54621
datamodel-code-generator generates Python data models from schema …
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.
What to do now
- Check your exposureFind out whether the affected software runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Set the orderSystems that can be reached from the internet come first, then the rest.
References
- github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-j884-q54q-mmx3
- github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.1
- github.com/advisories/GHSA-j884-q54q-mmx3
- github.com/koxudaxi/datamodel-code-generator/commit/aec47bc414779f4a9992b3919c8f7663afd6c9
- nvd.nist.gov/vuln/detail/CVE-2026-54621
- cve.org/CVERecord?id=CVE-2026-54621
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.