CVE-2026-55391: datamodel-code-generator vulnerable to SSRF protection bypass via DNS rebinding
datamodel-code-generator’s anti-SSRF guard validates the resolved IP of a fetch target once and then lets httpx perform its own independent DNS resolution to connect, so the validated address is never pinned. A hostname that resolves to a public IP at validation time and a private IP at connection time (DNS rebinding) bypasses the guard and reaches loopback, link-local cloud-metadata endpoints (169.254.169.254), and other internal services — even with the default allow_private_network=False. This is a server-side request forgery reachable when the tool fetches an attacker-influenced URL (remote $ref, or --url).
References
- github.com/advisories/GHSA-vx7x-vcc2-c44g
- github.com/koxudaxi/datamodel-code-generator/commit/25c8b7e497419eb20b230fa3318c04f9bebc5a6f
- github.com/koxudaxi/datamodel-code-generator/releases/tag/0.63.0
- github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-vx7x-vcc2-c44g
- nvd.nist.gov/vuln/detail/CVE-2026-55391
Code Behaviors & Features
Detect and mitigate CVE-2026-55391 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →