CVE-2026-54653: `datamodel-code-generator` vulnerable to code injection in via attacker-controlled `default_factory` schema field
koxudaxi · datamodel-code-generator
Affected: koxudaxi datamodel-code-generator · Exploitation: unlikely (under 1%)
Not in CyberSIXT coverage yet: no article names this CVE. This page shows the public record.
Higher than 54% of scored CVEs
DescriptionCVE.org
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.
Affected products1
From the CVE record. A product or version that is not listed is unknown, not unaffected.
- koxudaxi · datamodel-code-generator>= 0.17.0, < 0.60.2
On the Atlas
Every published CVE is on the CyberSIXT Atlas, grouped by weakness, vendor and month.
- Exploitation
- Unlikely (under 1%). EPSS under 1%, or no score yet.
- CISA KEV
- Not listed
- Public check
- No public nuclei template
- Weakness
- Improper Neutralization of Special Elements Used in a Template Engine · Command and Code Injection
- Vendor
- koxudaxi
- Published
- July 2026
CoverageNo articles yet
No CyberSIXT article names CVE-2026-54653 yet, so there is no coverage timeline, action brief or change log for it. Everything on this page comes from the public CVE record, CISA KEV, EPSS and the nuclei template index. Search the archive or see the CVEs in the news.
References
- NVD entrynvd.nist.gov
- CVE recordcve.org
- Weakness CWE-1336cwe.mitre.org
- github.com/koxudaxi/datamodel-code-generator/security/advisoriesgithub.com
- github.com/koxudaxi/datamodel-code-generator/commit/17fc235e234cgithub.com
- github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.2github.com
- Exploitgist.github.com