{
  "id": "CVE-2026-127208",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-127208",
  "published_at": "2026-11-12T20:58:59.634Z",
  "title": "datamodel-code-generator \u003c 0.84.0 Code Injection via x-python-type Annotation",
  "vendor": "datamodel-code-generator",
  "product": "datamodel-code-generator",
  "cvss": {
    "score": 8.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:N/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 before 0.84.0 contains a code injection vulnerability that allows attackers to achieve arbitrary code execution by supplying a malicious JSON Schema with a crafted x-python-type annotation containing a string ast.Constant node in a subscript slice position, which bypasses validation in parse_python_type_annotation and _python_type_expr_from_ast. Attackers can embed malicious Python expressions such as __import__ calls within quoted string literals in the generated source code, which Pydantic v2 evaluates as a ForwardRef via eval() during model_rebuild(), resulting in arbitrary code execution on developer workstations, CI/CD pipelines, or applications that generate and import the produced models at runtime.",
  "cwe": "CWE-94",
  "cvss_by_source": {
    "cna": 8.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "datamodel-code-generator",
        "product": "datamodel-code-generator",
        "ranges": [
          "\u003c 0.84.0"
        ],
        "fixed_in": [
          "0.84.0"
        ]
      }
    ],
    "upgrade": [
      "Upgrade datamodel-code-generator to 0.84.0 or later."
    ],
    "references": [
      {
        "kind": "Release notes",
        "url": "https://github.com/datamodel-code-generator/datamodel-code-generator/releases/tag/0.84.0"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/datamodel-code-generator/datamodel-code-generator/commit/ebfc11d0644d37a71374b28aac06d98748e584ec"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
