datamodel-code-generator SSRF Flaw Exposed Internal Networks via `--url` Fetches
Vulnerability Disclosure · 2 sources · Updated 3mo ago · First seen Jun 8, 2026

A high-severity server-side request forgery vulnerability, CVE-2026-54691, was disclosed in datamodel-code-generator, affecting versions 0.9.1 through 0.60.x. The flaw stems from the tool's HTTP fetch logic accepting user-supplied --url targets and redirect destinations without validating the host or IP address, allowing requests to reach localhost, loopback, private, link-local, metadata, and other non-public network resources. The issue is rated CVSS 8.2 and is considered remotely exploitable.
The project addressed the issue in version 0.61.0 with changes that block HTTP(S) requests to non-public network targets by default and validate redirect destinations before following them. The patch also introduced --allow-private-network and --no-allow-private-network options so users can explicitly opt in to trusted internal schema endpoints, while preserving public remote schema and $ref fetching behavior with warnings and updated tests, documentation, and CLI/config handling.


