3 matches found
`datamodel-code-generator` vulnerable to code execution on import via unescaped `validators` entries in --extra-template-data
Summary When the Pydantic v2 output mode is in use, datamodel-code-generator reads a validators array from each model entry in the --extra-template-data file and synthesises a Pydantic @fieldvalidator... decorator from each entry. The field names and the validator mode are interpolated into the...
CVE-2026-54656
CVE-2026-54656 affects datamodel-code-generator (0.52.1–0.60.2). The issue arises when validators are interpolated from --extra-template-data into @field_validator decorators via _process_validators in src/datamodel_code_generator/model/pydantic_v2/base_model.py, enabling Python code execution up...
CVE-2026-54655
Summary: datamodel-code-generator (Python) is vulnerable from versions 0.51.0 through 0.60.2 where x-python-type values parsed by src/datamodel_code_generator/parser/jsonschema.py in _get_python_type_override are injected into generated field annotations without sufficient validation, allowing at...