Summary
SurrealDB does not consistently apply network deny rules after resolving hostnames used by its http::* functions. An authenticated user may therefore cause requests to restricted internal addresses, potentially exposing or modifying sensitive services and credentials when the deployment permits access to those endpoints.
Affected context
The issue occurs in SurrealDB deployments that expose the http::* functions to authenticated users and rely on --deny-net restrictions to control outbound network access. It becomes risky when a supplied hostname resolves to an address that should be denied, but the resolved destination is not validated against the configured network policy before the request is sent.
Exploit preconditions
- Attack surface: SurrealDB's http::* functions and their outbound request
capability
- Required access: Authenticated access sufficient to invoke the affected
database functions
- Trigger point: Processing an HTTP request to a hostname whose DNS result
maps to a restricted network address
- Why exploitation is possible: Network restrictions are not reliably
enforced against the DNS-resolved destination before the server performs
the request
Why this happens
The underlying flaw is an authorization-check bypass in outbound network filtering. The server evaluates the requested hostname or URL without consistently applying the same policy to the address returned by DNS resolution. This maps to CWE-863 because an authenticated operation can bypass an intended authorization constraint and reach resources outside the permitted network scope.
Potential impact
- An attacker may access restricted internal HTTP services.
- Sensitive application data or credentials could be disclosed.
- Internal endpoints may be modified if the contacted service accepts write operations.
- The issue could enable further compromise through reachable administrative or cloud metadata services.
- Network segmentation assumptions could be weakened.
General mitigation guidance
Mitigation generally focuses on enforcing outbound network policy after every hostname resolution and before connection establishment, including protection against changes between resolution and connection. Secure-by-default designs can disable or narrowly scope database-initiated HTTP requests, use explicit destination allowlists, and restrict access to http::* functions by role. Network-level egress controls, least-privilege service identities, isolated runtime environments, and reduced credential exposure can limit consequences. DNS resolution and address validation should be treated as untrusted input, with consistent handling for redirects and alternate address families.
How teams detect issues like this
Detection approaches can include static and semantic analysis for outbound request code that validates only user-supplied hostnames, code review checks for authorization decisions made before DNS resolution, and tests covering denied private, loopback, link-local, and internal address ranges. Egress firewall and proxy policies can alert on database processes contacting protected networks. Audit logging can correlate http::* invocations, resolved destinations, and blocked or permitted connections. Automated security review tools may help identify incomplete SSRF and network-policy enforcement patterns.

