PoC Monitor
← All CVEs
CVE-2026-54653published 28 Jul 2026 21:48 UTCData: JSON · API

Koxudaxi datamodel-code-generator

`datamodel-code-generator` vulnerable to code injection in via attacker-controlled `default_factory` schema field

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.

First public PoC None yetno public PoC found
Public PoCs00 on GitHub
CVSS8.8high · scored by CNA · CWE-94
CISA KEV Not listednot known exploited

Affected versions and mitigation

From the CVE record and the vendor's references.

Affected

koxudaxi datamodel-code-generator
  • >= 0.17.0, < 0.60.2

Fixed in 0.60.2

Mitigation

Upgrade datamodel-code-generator to 0.60.2 or later.

References

Timeline

Days relative to CVE publication
-2t=0+2+4+6+8CVE published28 Jul 2026 · t = 0

No public PoC found yet; not in CISA KEV.

PoC repositories

Found on GitHub.

No PoC repositories found yet.

Other public exploits

Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.
SourceTitlePublishedFound by us
CVE record (tagged exploit)https://gist.github.com/thegr1ffyn/9648b0fe4fcf7d569ac8e61dd11eebafunknown14 Nov 2026