Summary
A server-side request forgery (SSRF) flaw in Directus allows authenticated users with file-upload permissions to bypass IP-based protections using the 0.0.0.0 address.
On Linux and macOS systems, 0.0.0.0 effectively routes to localhost, enabling the server to fetch internal services via the file import endpoint and return their responses as downloadable files.
Affected context
This vulnerability appears in Directus deployments that:
- Expose the
/files/importendpoint to authenticated users with file-upload rights - Rely on IP denylisting (including localhost) to prevent SSRF
- Run on platforms where
0.0.0.0resolves to local network interfaces, such as Linux and macOS
It is most relevant in environments where internal HTTP services, admin panels, or metadata endpoints are reachable from the Directus server's network context.
Exploit preconditions
- Attack surface: Directus
/files/importfile-import-from-URL feature - Required access: Authenticated access with permissions to upload or import files
- Trigger point: Supplying
http://0.0.0.0:<port>/...or similar URLs to the import-from-URL mechanism - Why exploitation is possible: The SSRF filter treats
0.0.0.0as a keyword for local interfaces without blocking the literal IP address, allowing requests to internal services that appear as regular outbound requests.
Why this happens
The core issue is an incomplete validation of destination addresses in server-initiated HTTP requests, mapped to CWE-918: Server-Side Request Forgery (SSRF).
The Directus IP-denial logic conceptually recognizes localhost and internal interfaces but fails to treat 0.0.0.0 as a concrete address that must be blocked.
As a result, the application trusts user-supplied URLs and permits the backend to act as a proxy to internal network targets, violating the intended isolation between user inputs and sensitive internal services.
Potential impact
- Unauthorized access to internal HTTP services that are not meant to be publicly reachable
- Exposure of configuration endpoints, diagnostics pages, or internal APIs through downloaded response files
- Potential access to cloud instance metadata services or secrets if reachable from the Directus host
- Information gathering that could assist lateral movement or privilege escalation within the infrastructure
General mitigation guidance
Effective mitigation centers on reducing trust in user-supplied URLs and hardening outbound request controls.
Common defensive patterns include:
- Implementing strict allowlists for external domains that can be used for file import, rather than relying solely on denylists
- Normalizing and validating destination IPs and hostnames, including special addresses like
0.0.0.0, localhost variants, and private network ranges - Enforcing network-level egress controls so application servers cannot freely reach internal services or metadata endpoints
- Reducing privileges of the Directus runtime and segregating it from sensitive internal interfaces through network segmentation
How teams detect issues like this
Organizations can detect SSRF-style risks by:
- Using static analysis or code scanning rules that flag user-controlled URLs passed directly to HTTP clients without robust validation
- Reviewing request-filtering utilities for incomplete coverage of special IP addresses, localhost variants, and private ranges
- Monitoring application logs and network telemetry for unusual requests to
0.0.0.0,127.0.0.1, or internal IP ranges originating from web application processes - Enforcing development policies that require explicit outbound domain allowlists and threat modeling for any server-side HTTP client features

