Quick answers
- Is CVE-2026-54653 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-54653 being exploited in the wild.
- How severe is CVE-2026-54653?
- High severity, with a CVSS score of 8.8, published 28 July 2026.
- Which products and versions are affected?
- Koxudaxi Datamodel-Code-Generator >= 0.17.0, < 0.60.2, >= 0.17.0, <= 0.60.1; datamodel-code-generator (PyPI) ECOSYSTEM:introduced=0.17.0,fixed=0.60.2.
- Is there a fix for CVE-2026-54653?
- 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-54653 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2026-54653?
- 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
The vulnerability is a code injection flaw (CWE-94/CWE-1336) residing in the JSON Schema parser component. The generator preserves attacker-controlled 'default_factory' values from input schemas (OpenAPI, JSON Schema, etc.) and interpolates them verbatim into the generated Python code's Field() or field() arguments without proper sanitization or escaping. Because these assignments are evaluated at class-definition time, the injected Python expressions execute automatically when the resulting module is imported. The attack requires the victim to run the generator against a malicious schema and subsequently import the output. This affects Pydantic v2, dataclass, and msgspec output types. The issue is fixed in version 0.60.2 by restricting 'default_factory' values to a safe allowlist (dict, list, set).
Affected products
- koxudaxi datamodel-code-generator >= 0.17.0, < 0.60.2
Identifiers
- CVE-2026-54653
- GHSA-386q-5hp3-95m9
- PYSEC-2026-3555
Timeline
- 2026-06-08: patched: Fixed in version 0.60.2
- 2026-06-08: advisory: GitHub Security Advisory GHSA-386q-5hp3-95m9 published
- 2026-07-28: disclosed: CVE-2026-54653 published to NVD