{
  "id": "CVE-2026-54621",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-54621",
  "published_at": "2026-07-28T21:35:27.863Z",
  "title": "`datamodel-code-generator` vulnerable to code injection via unescaped carriage return in GraphQL Union description",
  "vendor": "koxudaxi",
  "product": "datamodel-code-generator",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "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.",
  "cwe": "CWE-94",
  "cvss_by_source": {
    "cna": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "koxudaxi",
        "product": "datamodel-code-generator",
        "ranges": [
          "\u003e= 0.25.0, \u003c 0.60.1"
        ],
        "fixed_in": [
          "0.60.1"
        ]
      }
    ],
    "upgrade": [
      "Upgrade datamodel-code-generator to 0.60.1 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-j884-q54q-mmx3"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/koxudaxi/datamodel-code-generator/commit/aec47bc414779f4a9992b3919c8f7663afd6c988"
      },
      {
        "kind": "Release notes",
        "url": "https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.1"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
