Summary
Open-WebSearch's URL safety checks fail to properly validate IPv6 literal URLs and do not perform DNS resolution, which allows crafted URLs to bypass protections.
When an attacker can influence target URLs, this flaw can enable non-blind SSRF, with the full HTTP response body from internal or restricted hosts being returned to the caller.
Affected context
This issue arises in Open-WebSearch deployments that rely on isPublicHttpUrl / assertPublicHttpUrl in src/utils/urlSafety.ts for outbound URL validation.
The vulnerable context includes:
- Environments where user input or agent-supplied URLs are passed through these helpers before performing HTTP requests
- Scenarios where IPv6 literal addresses (e.g.,
[::1]) or hostnames resolving to internal networks are reachable from the Open-WebSearch process
The problem is more relevant when Open-WebSearch can reach internal services, metadata endpoints, or other non-public HTTP resources.
Exploit preconditions
- Attack surface: Any feature where Open-WebSearch fetches remote content based on a supplied URL (e.g., search, retrieval, or connector-like functionality).
- Required access: Ability to provide or influence a URL parameter that is validated only by
isPublicHttpUrl/assertPublicHttpUrl. - Trigger point: Submission of a crafted URL using bracketed IPv6 literals or hostnames that resolve to internal addresses, bypassing checks.
- Why exploitation is possible:
- The URL safety functions do not recognize bracketed IPv6 literals as potentially sensitive targets.
- The functions do not perform DNS resolution, so they cannot detect when ostensibly "public" hostnames actually resolve to internal or private IP ranges.
- As a result, the application may initiate HTTP requests to internal resources and relay the response body back to the caller.
Why this happens
The vulnerability stems from incomplete URL validation logic and insufficient enforcement of network boundaries in the URL safety helpers.
Instead of normalizing and fully interpreting the URL (including IPv6 literal syntax and DNS resolution), the implementation relies on simplified checks that assume certain patterns correspond to public HTTP endpoints.
This aligns with CWE-918: Server-Side Request Forgery (SSRF), where a server-side component makes attacker-controlled HTTP requests without correctly constraining the reachable destinations.
By omitting DNS resolution and mishandling IPv6 literals, the code permits outbound connections to unintended internal or non-public hosts while still returning their responses.
Potential impact
- Access to internal HTTP services that are not otherwise exposed publicly.
- Retrieval of sensitive configuration data, metadata endpoints, or internal APIs.
- Pivoting into internal networks for further reconnaissance via response content.
- Potential exposure of secrets, tokens, or service endpoints embedded in internal responses.
- Use of the application as a proxy to bypass network segmentation or firewall rules for HTTP traffic.
General mitigation guidance
Mitigation generally focuses on strictly constraining where server-side HTTP clients may connect and ensuring URL validation is network-aware.
Common defensive patterns include:
- Implementing allowlist-based outbound connection policies, restricting requests to explicitly approved domains or IP ranges.
- Performing full URL normalization, including proper parsing of IPv4, IPv6 (bracketed literals), and hostnames, before applying safety decisions.
- Resolving hostnames server-side and validating the resulting IPs against policies that disallow private, loopback, link-local, and metadata networks.
- Separating internal network access from user-controlled URL fetching, using dedicated services or proxies with strong policy enforcement.
- Applying least-privilege network configurations at the infrastructure level (e.g., firewall rules, VPC security groups) to limit what the service can reach, even if application checks fail.
How teams detect issues like this
Detection efforts typically focus on both code-level patterns and runtime behavior:
- Static analysis / code review:
- Flag custom URL validators that only perform string-level checks without DNS resolution or IP range validation.
- Identify HTTP client calls where destinations are derived from user input but are not checked against an allowlist or network policy.
- Look for special-case handling omissions, such as missing IPv6 literal and loopback address handling.
- Policy enforcement:
- Introduce review policies requiring all outbound HTTP logic to use shared, security-reviewed URL safety utilities.
- Enforce network egress policies via infrastructure-as-code checks (e.g., composition of security groups, firewall rules).
- Runtime monitoring:
- Log outbound HTTP requests initiated by the service and alert on connections to internal IP ranges or unexpected domains.
- Use network monitoring tools to detect anomalous connections from the service to metadata or management endpoints.

