{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-54653","id":"CVE-2026-54653","title":"`datamodel-code-generator` vulnerable to code injection in via attacker-controlled `default_factory` schema field","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 the","descriptionLong":"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.","published":"2026-07-28T21:48:04.619Z","updated":"2026-10-28T02:30:39.045999640Z","reserved":"2026-06-15T20:16:46.199Z","status":"Analyzed","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","rating":"high","source":"GitHub_M"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","rating":"high","source":"github.com"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","rating":"high","source":"OSV"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","rating":"high","source":"GitHub"}],"rating":"high","products":["koxudaxi datamodel-code-generator"],"affectedProducts":[{"vendor":"koxudaxi","product":"datamodel-code-generator","defaultStatus":null,"versions":[{"version":">= 0.17.0, < 0.60.2","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"datamodel-code-generator","purl":"pkg:pypi/datamodel-code-generator","ranges":[">=0.17.0 <0.60.2"],"fixed":["0.60.2"],"advisory":"GHSA-386q-5hp3-95m9"}],"cwes":["CWE-94","CWE-1336"],"aliases":["GHSA-386q-5hp3-95m9","PYSEC-2026-3555"],"references":[{"url":"https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-386q-5hp3-95m9","tags":["x_refsource_CONFIRM","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/koxudaxi/datamodel-code-generator/commit/17fc235e234cbcfaaadef8c74cb72c9687db0d1d","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.2","tags":["x_refsource_MISC","Release Notes","web"]},{"url":"https://gist.github.com/thegr1ffyn/9648b0fe4fcf7d569ac8e61dd11eebaf","tags":["exploit","Third Party Advisory","evidence"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54653.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54653","tags":["advisory"]},{"url":"https://github.com/koxudaxi/datamodel-code-generator","tags":["package"]},{"url":"https://pypi.org/project/datamodel-code-generator","tags":["package"]},{"url":"https://github.com/advisories/GHSA-386q-5hp3-95m9","tags":["advisory"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total"},"epss":0.00711,"epssPercentile":0.54329,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-54653","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54653","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-54653","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-386q-5hp3-95m9","ok":true,"note":"GHSA-386q-5hp3-95m9"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-54653","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}