{"cve":"CVE-2026-54621","nvd":{"published":"2026-07-28T22:17:39.930","modified":"2026-10-23T23:10:00.157","status":"Deferred","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8},"cwes":["CWE-94","CWE-1336"],"references":["https://github.com/koxudaxi/datamodel-code-generator/commit/aec47bc414779f4a9992b3919c8f7663afd6c988","https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.1","https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-j884-q54q-mmx3"],"products":[],"source":"nvd","synced_at":"2026-10-24T16:53:27.712498749+00:00"},"epss":{"cve":"CVE-2026-54621","score":0.0021,"percentile":0.11136,"date":"2026-10-26"},"kev":null,"osv":[{"id":"GHSA-j884-q54q-mmx3","url":"https://osv.dev/vulnerability/GHSA-j884-q54q-mmx3","summary":"`datamodel-code-generator` vulnerable to code injection via unescaped carriage return in GraphQL Union description","modified":"2026-09-10T03:50:12.337188755Z","packages":[{"ecosystem":"PyPI","name":"datamodel-code-generator","purl":"pkg:pypi/datamodel-code-generator","ranges":[">=0.25.0 <0.60.1"],"fixed":["0.60.1"]}]},{"id":"PYSEC-2026-3561","url":"https://osv.dev/vulnerability/PYSEC-2026-3561","summary":"`datamodel-code-generator` vulnerable to code injection via unescaped carriage return in GraphQL Union description","modified":"2026-08-04T14:30:14.927785546Z","packages":[{"ecosystem":"PyPI","name":"datamodel-code-generator","purl":"pkg:pypi/datamodel-code-generator","ranges":[">=0.25.0 <0.60.1"],"fixed":["0.60.1"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}