CyberRota Analysis
AI-GeneratedThe datamodel-code-generator versions 0.52.1 to 0.60.2 are vulnerable due to unsafe interpolation of validators, which can lead to arbitrary Python code execution when importing generated Pydantic v2 models. This high-severity vulnerability poses a significant risk to developers using these versions, particularly those integrating OpenAPI, JSON Schema, or other data formats into their applications. Organizations utilizing these affected versions should prioritize upgrading to version 0.60.2 or later to mitigate potential exploitation.
Public Exploit Signal
A public exploit, PoC, GitHub repository or Metasploit reference was detected for this CVE.
Note: these links are listed for security research and verification purposes only.
Original NVD 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.
Related CVEs
Other vulnerabilities affecting the same vendor(s)