CVE-2026-54621 `datamodel-code-generator` vulnerable to code injection via unescaped carriage return in GraphQL Union description
HighCVSS 7.8
EPSS 0.21%
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: total
Description
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.
Upgrade path
2 packages: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| pypi datamodel-code-generator(PyPI) | = 0.25.0; = 0.25.1; = 0.25.2; = 0.25.3 +67 more | 0.60.1 | Fixed |
| koxudaxi datamodel-code-generator | = >= 0.25.0, < 0.60.1 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi datamodel-code-generator(PyPI) | >= 0.25.0, < 0.60.1 | 0.60.1 |
| pypi datamodel-code-generator(PyPI) | = 0.25.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.2 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.3 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.4 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.5 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.6 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.7 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.8 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.25.9 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.26.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.26.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.26.2 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.26.3 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.26.4 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.26.5 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.27.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.27.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.27.2 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.27.3 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.28.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.28.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.28.2 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.28.3 | No fix listed |
Show 47 more
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi datamodel-code-generator(PyPI) | = 0.28.4 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.28.5 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.29.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.30.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.30.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.30.2 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.31.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.31.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.31.2 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.32.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.33.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.34.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.35.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.36.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.37.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.38.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.39.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.40.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.41.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.42.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.42.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.42.2 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.43.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.43.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.44.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.45.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.46.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.47.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.48.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.49.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.50.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.51.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.52.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.52.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.52.2 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.53.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.54.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.54.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.55.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.56.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.56.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.57.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.58.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.59.0 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.59.1 | No fix listed |
| pypi datamodel-code-generator(PyPI) | = 0.60.0 | No fix listed |
| koxudaxi datamodel-code-generator | = >= 0.25.0, < 0.60.1 | No fix listed |
References
- https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-j884-q54q-mmx3 vendor-advisory
- github.com product
- https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.1
- https://github.com/koxudaxi/datamodel-code-generator/commit/aec47bc414779f4a9992b3919c8f7663afd6c988
- pypi.org product
- github.com vendor-advisory
- nvd.nist.gov vendor-advisory