{
  "id": "CVE-2026-54653",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-54653",
  "published_at": "2026-07-28T21:48:04.619Z",
  "title": "`datamodel-code-generator` vulnerable to code injection in via attacker-controlled `default_factory` schema field",
  "vendor": "koxudaxi",
  "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 generates Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON, YAML, or CSV. From  0.17.0 until 0.60.2, datamodel-code-generator preserves attacker-controlled default_factory values in src/datamodel_code_generator/parser/jsonschema.py through JsonSchemaObject.init and get_field_extras and emits them into Field(default_factory=...) or field(default_factory=...), allowing Python expression execution when the generated model is imported. This issue is fixed in version 0.60.2.",
  "cwe": "CWE-94",
  "cpes": [
    "cpe:2.3:a:koxudaxi:datamodel-code-generator:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 8.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "koxudaxi",
        "product": "datamodel-code-generator",
        "ranges": [
          "\u003e= 0.17.0, \u003c 0.60.2"
        ],
        "fixed_in": [
          "0.60.2"
        ]
      }
    ],
    "upgrade": [
      "Upgrade datamodel-code-generator to 0.60.2 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-386q-5hp3-95m9"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/koxudaxi/datamodel-code-generator/commit/17fc235e234cbcfaaadef8c74cb72c9687db0d1d"
      },
      {
        "kind": "Release notes",
        "url": "https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.2"
      }
    ]
  },
  "exploit_refs": [
    {
      "url": "https://gist.github.com/thegr1ffyn/9648b0fe4fcf7d569ac8e61dd11eebaf",
      "source": "cvelist",
      "title": "",
      "published_at": null,
      "first_seen_at": "2026-11-14T10:26:36.149Z"
    }
  ],
  "hunt_profile": [],
  "rules": []
}
