# CVE-2026-54690: koxudaxi datamodel-code-generator SSRF via JSON Schema $ref

Source: https://junglewise.ai/threats/cve-2026-54690-koxudaxi-datamodel-code-generator-ssrf-via-json-schema-ref  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-28. Updated: 2026-07-28  
License: CC BY 4.0 with a link back

CVE-2026-54690 · Severity: high · CVSS 8.2 · Published 2026-07-28

datamodel-code-generator is a tool used by developers to automatically create Python code from data schemas like OpenAPI or JSON Schema. A security flaw allows an attacker to provide a malicious schema file that forces the tool to make unauthorized network requests to internal services or private data centers. If exploited, sensitive information from these internal systems—such as cloud credentials or private database records—could be leaked directly into the generated Python code, potentially exposing it to the developer or within automated build systems.

Technologies: [Koxudaxi Datamodel-Code-Generator](https://junglewise.ai/threats/technologies/datamodel-code-generator), [datamodel-code-generator (PyPI)](https://junglewise.ai/threats/technologies/pypi-datamodel-code-generator). Vendors: [Koxudaxi](https://junglewise.ai/threats/vendors/koxudaxi), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-54690 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-54690 being exploited in the wild.

**How severe is CVE-2026-54690?** High severity, with a CVSS score of 8.2, published 28 July 2026.

**Which products and versions are affected?** Koxudaxi Datamodel-Code-Generator >= 0.9.1, < 0.61.0, >= 0.9.1, <= 0.60.2; datamodel-code-generator (PyPI) ECOSYSTEM:introduced=0.9.1,fixed=0.61.0.

**Is there a fix for CVE-2026-54690?** Yes. datamodel-code-generator (PyPI): upgrade to 0.61.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-54690 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-54690?** 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.61.0 or later

  ```sh
  pip install "datamodel-code-generator>=0.61.0"
  ```


## Technical details

A Server-Side Request Forgery (SSRF) vulnerability exists in datamodel-code-generator within the `_get_ref_body` function of `src/datamodel_code_generator/parser/jsonschema.py`. The tool silently dereferences HTTP/HTTPS URLs in JSON Schema `$ref` fields without validating the destination IP or host, even when the `--allow-remote-refs` gate is at its default setting (which only issues a deprecation warning). An attacker can craft a schema that points to internal metadata services (e.g., AWS IMDS) or private network endpoints; the tool will fetch the content and reflect the response body into the generated Python models. This affects users who have installed the `[http]` extra. The issue is fixed in version 0.61.0 by implementing strict validation of redirect targets and blocking non-public network ranges by default unless the new `--allow-private-network` flag is used.

## Affected products

- koxudaxi datamodel-code-generator >= 0.9.1, < 0.61.0

## Identifiers

- CVE-2026-54690
- GHSA-954p-556p-r752
- PYSEC-2026-3560

## Timeline

- 2026-06-08: patched: Version 0.61.0 released
- 2026-06-08: advisory: GitHub Security Advisory GHSA-954p-556p-r752 published
- 2026-07-28: disclosed: CVE-2026-54690 published to NVD

## References

- [https://github.com/koxudaxi/datamodel-code-generator/commit/5fdba4a09f2d7a9996a504975b7ef7d63e3715bb](https://github.com/koxudaxi/datamodel-code-generator/commit/5fdba4a09f2d7a9996a504975b7ef7d63e3715bb)
- [https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.61.0](https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.61.0)
- [https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-954p-556p-r752](https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-954p-556p-r752)

## Related threats

- [datamodel-code-generator Protobuf path traversal allows files to be written outside directory](https://junglewise.ai/threats/cve-2026-107377-datamodel-code-generator-protobuf-weak-import-path-traversal)
- [koxudaxi datamodel-code-generator code injection in generated imports](https://junglewise.ai/threats/cve-2026-55415-koxudaxi-datamodel-code-generator-code-injection-in-generated)
- [koxudaxi datamodel-code-generator credential leak in cross-origin redirects](https://junglewise.ai/threats/cve-2026-55403-koxudaxi-datamodel-code-generator-credential-leak-in-cross-origin)
- [koxudaxi datamodel-code-generator SSRF via DNS rebinding](https://junglewise.ai/threats/cve-2026-55391-koxudaxi-datamodel-code-generator-ssrf-via-dns-rebinding)
- [koxudaxi datamodel-code-generator path traversal in XML Schema parsing](https://junglewise.ai/threats/cve-2026-55390-koxudaxi-datamodel-code-generator-path-traversal-in-xml-schema)
