CVE-2026-54656
Full vulnerability record from the local CVENow database.
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.52.1 until 0.60.2, datamodel-code-generator interpolates validators from --extra-template-data in src/datamodel_code_generator/model/pydantic_v2/base_model.py through _process_validators 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.
Severity
HIGH
CVSS score
7.8
(v3.1)
Vulnerability status
Analyzed
Source identifier
Published
2026-07-28 22:17:40.507000
Last modified
2026-10-23 23:10:00.157000
View original CVE JSON
{
"id": "CVE-2026-54656",
"sourceIdentifier": "[email protected]",
"published": "2026-07-28T22:17:40.507",
"lastModified": "2026-10-23T23:10:00.157",
"vulnStatus": "Analyzed",
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "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/datamodel_code_generator/model/pydantic_v2/base_model.py through _process_validators 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."
},
{
"lang": "es",
"value": "datamodel-code-generator genera modelos Pydantic v2, dataclasses, TypedDict y msgspec.Struct a partir de OpenAPI, JSON Schema, GraphQL, Avro, Protobuf y JSON, YAML o CSV en bruto. Desde 0.52.1 hasta 0.60.2, datamodel-code-generator interpola validadores desde --extra-template-data en src/datamodel_code_generator/model/pydantic_v2/base_model.py a través de _process_validators en decoradores @field_validator sin validación segura, permitiendo la ejecución de código Python cuando se importa el modelo Pydantic v2 generado. Este problema está corregido en la versión 0.60.2."
}
],
"affected": [
{
"source": "[email protected]",
"affectedData": [
{
"vendor": "koxudaxi",
"product": "datamodel-code-generator",
"versions": [
{
"version": ">= 0.52.1, < 0.60.2",
"status": "affected"
}
]
}
]
}
],
"metrics": {
"cvssMetricV31": [
{
"source": "[email protected]",
"type": "Secondary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"baseScore": 7.8,
"baseSeverity": "HIGH",
"attackVector": "LOCAL",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "REQUIRED",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH"
},
"exploitabilityScore": 1.8,
"impactScore": 5.9
}
],
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"timestamp": "2026-07-29T14:12:01.711005Z",
"id": "CVE-2026-54656",
"options": [
{
"exploitation": "poc"
},
{
"automatable": "no"
},
{
"technicalImpact": "total"
}
],
"role": "CISA Coordinator",
"version": "2.0.3"
}
}
]
},
"weaknesses": [
{
"source": "[email protected]",
"type": "Secondary",
"description": [
{
"lang": "en",
"value": "CWE-94"
}
]
}
],
"configurations": [
{
"nodes": [
{
"operator": "OR",
"negate": false,
"cpeMatch": [
{
"vulnerable": true,
"criteria": "cpe:2.3:a:koxudaxi:datamodel-code-generator:*:*:*:*:*:*:*:*",
"versionStartIncluding": "0.52.1",
"versionEndExcluding": "0.60.2",
"matchCriteriaId": "A8010A4B-D682-46DC-A099-F84C330EDC85"
}
]
}
]
}
],
"references": [
{
"url": "https://github.com/koxudaxi/datamodel-code-generator/commit/a43d02906111a2fdcaf13ee5b62eb2da85376f19",
"source": "[email protected]",
"tags": [
"Patch"
]
},
{
"url": "https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.2",
"source": "[email protected]",
"tags": [
"Release Notes"
]
},
{
"url": "https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-8m8r-38jm-f355",
"source": "[email protected]",
"tags": [
"Exploit",
"Vendor Advisory"
]
},
{
"url": "https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-8m8r-38jm-f355",
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"tags": [
"Exploit",
"Vendor Advisory"
]
}
]
}