# CVE-2026-55391: koxudaxi datamodel-code-generator SSRF via DNS rebinding

Source: https://junglewise.ai/threats/cve-2026-55391-koxudaxi-datamodel-code-generator-ssrf-via-dns-rebinding  
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-55391 · Severity: high · CVSS 7.5 · Published 2026-07-28

datamodel-code-generator is a tool used to convert data schemas (like OpenAPI or JSON Schema) into Python code. A security flaw allows an attacker to bypass built-in protections and force the tool to connect to internal private servers or cloud metadata services. This could lead to the exposure of sensitive internal data or credentials if the tool is used to process untrusted web addresses or schemas.

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-55391 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-55391 being exploited in the wild.

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

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

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

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

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

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


## Technical details

A Server-Side Request Forgery (SSRF) vulnerability exists in datamodel-code-generator due to a Time-of-Check Time-of-Use (TOCTOU) flaw in its HTTP fetching logic. The tool validates a URL's resolved IP address against a blocklist of private networks but then allows the underlying HTTP client (httpx) to perform a second, independent DNS resolution during the actual connection. An attacker can use a DNS rebinding attack—where a hostname initially resolves to a safe public IP during validation but then resolves to a private IP (e.g., 127.0.0.1 or 169.254.169.254) during the connection—to bypass the 'allow_private_network=False' guard. This allows the tool to fetch and potentially leak data from internal services or cloud metadata endpoints. The issue is fixed in version 0.63.0 by pinning the validated IP address for the duration of the request.

## Affected products

- koxudaxi datamodel-code-generator < 0.63.0

## Identifiers

- CVE-2026-55391
- GHSA-vx7x-vcc2-c44g
- PYSEC-2026-3565

## Timeline

- 2026-06-12: patched: Fixed in version 0.63.0
- 2026-07-28: disclosed: Public advisory and CVE published

## References

- [https://github.com/koxudaxi/datamodel-code-generator/commit/25c8b7e497419eb20b230fa3318c04f9bebc5a6f](https://github.com/koxudaxi/datamodel-code-generator/commit/25c8b7e497419eb20b230fa3318c04f9bebc5a6f)
- [https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.63.0](https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.63.0)
- [https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-vx7x-vcc2-c44g](https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-vx7x-vcc2-c44g)

## 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 path traversal in XML Schema parsing](https://junglewise.ai/threats/cve-2026-55390-koxudaxi-datamodel-code-generator-path-traversal-in-xml-schema)
- [koxudaxi datamodel-code-generator local file read via JSON Schema ref](https://junglewise.ai/threats/cve-2026-55389-koxudaxi-datamodel-code-generator-local-file-read-via-json-schema)
