CVE-2026-54656

Source
https://cve.org/CVERecord?id=CVE-2026-54656
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-54656.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-54656
Aliases
Published
2026-07-28T21:43:56.286Z
Modified
2026-07-29T11:30:24.858939332Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H CVSS Calculator
Summary
`datamodel-code-generator` vulnerable to code execution on import via unescaped `validators` entries in --extra-template-data
Details

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.52.1 until 0.60.2, datamodel-code-generator interpolates validators from --extra-template-data in src/datamodelcodegenerator/model/pydanticv2/basemodel.py through processvalidators into @field_validator decorators without safe validation, allowing Python code execution when the generated Pydantic v2 model is imported. This issue is fixed in version 0.60.2.

Database specific
{
    "cna_assigner": "GitHub_M",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54656.json",
    "cwe_ids": [
        "CWE-94"
    ]
}
References

Affected packages

Git / github.com/koxudaxi/datamodel-code-generator

Affected ranges

Type
GIT
Repo
https://github.com/koxudaxi/datamodel-code-generator
Events
Database specific
{
    "extracted_events": [
        {
            "introduced": "0.52.1"
        },
        {
            "fixed": "0.60.2"
        }
    ],
    "source": "AFFECTED_FIELD"
}

Affected versions

0.*
0.52.1
0.52.2
0.53.0
0.54.0
0.54.1
0.55.0
0.56.0
0.56.1
0.57.0
0.58.0
0.59.0
0.59.1
0.60.0
0.60.1

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-54656.json"