Summary
Directus, a real-time API and app dashboard for SQL databases, contained a Server-Side Request Forgery (SSRF) protection bypass in its IP address validation logic prior to version 11.16.0.
By encoding internal addresses using IPv4-mapped IPv6 notation, an attacker could potentially force the server to make requests to local or private network resources that were intended to be blocked.
Affected context
This vulnerability affects Directus deployments where server-side functionality can be used to initiate outbound HTTP or similar network requests based on user-supplied URLs or hostnames.
The issue specifically arises in environments relying on Directus' built-in IP validation to prevent access to internal or private network ranges.
When an attacker can influence the target URL or endpoint of such server-initiated requests, the IPv4-mapped IPv6 format provides a way around the existing network access checks.
Exploit preconditions
- Attack surface: Any Directus feature, extension, hook, or integration that:
- Accepts user-controlled URLs/hosts, and
- Causes the Directus server to perform outbound requests on behalf of the user.
- Required access: Ability to interact with the Directus API or application in a way that supplies or influences the requested URL (may be authenticated or unauthenticated depending on project configuration).
- Trigger point: Invocation of the server-side network request logic using a crafted URL that encodes internal/private IPs as IPv4-mapped IPv6 addresses.
- Why exploitation is possible: The IP validation routine blocking local and private ranges evaluated addresses in a way that did not correctly normalize or reject IPv4-mapped IPv6 representations, allowing internal destinations to slip through as if they were external.
Why this happens
The core issue is an incomplete validation scheme for outbound request destinations, falling under CWE-918 (Server-Side Request Forgery).
The defense relied on IP-based checks to block local and private networks, but the implementation assumed straightforward IPv4 or IPv6 text forms.
IPv4-mapped IPv6 notation (e.g., representing an IPv4 address within an IPv6 format) was not normalized or treated consistently, leaving a gap where internal IPs could be disguised as seemingly acceptable external addresses.
At an abstract level, the bug is a trust boundary failure: user-influenced URLs are not fully canonicalized and normalized before being evaluated against network access policies, resulting in a bypass of intended restrictions.
Potential impact
- Access to internal or private network services that should not be reachable from the outside.
- Interaction with metadata services or control-plane endpoints in certain hosting environments, which could lead to further compromise.
- Port scanning or network reconnaissance of internal infrastructure through the Directus server.
- Indirect data exposure if internal HTTP APIs return sensitive configuration, credentials, or system information.
- Potential chaining with other vulnerabilities on internal services (e.g., exploiting outdated admin interfaces reachable only from the internal network).
General mitigation guidance
Effective mitigation focuses on hardening both network egress controls and input validation for outbound requests:
- Normalize and canonicalize targets: Ensure all user-supplied hosts/IPs are fully normalized (including IPv6, IPv4-mapped IPv6, and hostname resolution) before applying allow/deny logic.
- Deny local and private ranges by design: Implement robust checks that explicitly block loopback, link-local, and RFC1918 private networks, including their IPv6 equivalents and mapped forms.
- Prefer allow-lists over block-lists: Where feasible, restrict outbound requests to a small, explicit set of trusted domains or services instead of trying to enumerate all disallowed address ranges.
- Decouple user input from direct network calls: Introduce an intermediate layer or service that maps user choices to predefined destinations, avoiding free-form URLs where possible.
- Network-level egress controls: Use firewalls, security groups, or service meshes to restrict the server's ability to contact internal or sensitive endpoints even if application-layer checks fail.
- Least-privilege configuration: Run Directus instances with minimal network privileges and avoid co-locating them in highly privileged subnets containing sensitive systems.
How teams detect issues like this
Detecting and monitoring for SSRF-style issues benefits from a combination of code-level and operational controls:
- Static analysis patterns:
- Flag code paths where user-controlled values are passed directly into HTTP client libraries or other network APIs.
- Look for custom IP validation or URL parsing routines that do not explicitly handle IPv4-mapped IPv6 and other edge-case notations.
- Code review signals:
- Any feature that fetches remote content, webhooks, or integrates with external APIs based on user input.
- Use of block-lists for private IP ranges instead of canonicalization plus strict allow-lists.
- IP checks implemented after DNS resolution without verifying all resolved addresses.
- Runtime monitoring:
- Log outbound requests and alert on attempts to reach local addresses (e.g., 127.0.0.0/8, ::1, 169.254.0.0/16, RFC1918 ranges) or cloud metadata endpoints.
- Monitor for unusual spikes in outbound connections from the Directus instance to unexpected internal services.
- Automated tooling:
- Incorporate security scanners or SSRF-focused tests within CI/CD that try various IP encoding tricks (IPv6, IPv4-mapped IPv6, dotted-decimal variants) against HTTP endpoints.

