Security mailing lists by PureSourceCode

CVE-2026-54655

HIGH 7.8CVSS 3.1

`datamodel-code-generator` vulnerable to code execution on import via `x-python-type` JSON-Schema extension in datamodel-code-generator

datamodel-code-generator generates Python data models from schema definitions. From 0.51.0 until 0.60.2, x-python-type values parsed by src/datamodel_code_generator/parser/jsonschema.py in _get_python_type_override are inserted into generated field annotations without sufficient validation, allowing attacker-controlled JSON Schema content to execute Python code when the generated module is imported. This issue is fixed in version 0.60.2.

Published
28 Jul 2026
Last modified
23 Oct 2026
Assigned by
security-advisories@github.com
NVD status
Deferred
Weakness
CWE-94
Also known as
GHSA-m34r-v34r-rf9qPYSEC-2026-3562
Sources
NVDJSONOSV GHSA-m34r-v34r-rf9qJSONOSV PYSEC-2026-3562JSON

Scores

SourceScored byVersionScoreVector / decision
NVD security-advisories@github.com (Secondary) CVSS 3.1 HIGH 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
OSV GitHub CVSS 3.1 HIGH 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
OSV PyPA CVSS 3.1 HIGH 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV PyPI datamodel-code-generator >= 0.51.0, < 0.60.2 0.60.2

References

History

  • 25 Nov 2026 21:04 UTC · NVD: first stored (published 28 Jul 2026)
  • 25 Nov 2026 20:12 UTC · OSV: first stored (published 4 Aug 2026)
  • 25 Nov 2026 20:11 UTC · OSV: first stored (published 28 Jul 2026)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.