Quick answers
- Is CVE-2026-54655 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-54655 being exploited in the wild.
- How severe is CVE-2026-54655?
- High severity, with a CVSS score of 7.8, published 28 July 2026.
- Which products and versions are affected?
- Koxudaxi Datamodel-Code-Generator >= 0.51.0, < 0.60.2, >= 0.51.0, <= 0.60.1; datamodel-code-generator (PyPI) ECOSYSTEM:introduced=0.51.0,fixed=0.60.2.
- Is there a fix for CVE-2026-54655?
- Yes. datamodel-code-generator (PyPI): upgrade to 0.60.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-54655 attacked?
- It is attacked with local access, in a software library.
- Am I affected by CVE-2026-54655?
- Check whether you run Koxudaxi Datamodel-Code-Generator or datamodel-code-generator (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- datamodel-code-generator (PyPI): upgrade to 0.60.2 or later
pip install "datamodel-code-generator>=0.60.2"
Technical details
A code injection vulnerability exists in datamodel-code-generator's JSON Schema parser within the `_get_python_type_override` method. The tool fails to sufficiently validate values provided in the `x-python-type` extension, forwarding them verbatim into generated Python field annotations. An attacker can craft a schema using specific syntax (e.g., using semicolons or brackets) to bypass the single sanitization check and embed arbitrary Python statements. These statements are executed at class-definition time when the generated module is imported. The vulnerability affects multiple output formats including Pydantic models, dataclasses, and TypedDicts. The issue is resolved in version 0.60.2 by implementing AST-based validation of type annotations.
Affected products
- koxudaxi datamodel-code-generator >= 0.51.0, < 0.60.2
Identifiers
- CVE-2026-54655
- GHSA-m34r-v34r-rf9q
- PYSEC-2026-3562
Timeline
- 2026-06-08: patched: Fix included in version 0.60.2
- 2026-07-28: disclosed: CVE-2026-54655 published