/

CVE-2026-40516

Severity:

HIGH RISK

(8.3)

SSRF in OpenHarness web_fetch and web_search Tools

CVE-2026-40516

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Unauthorized access to internal HTTP services and sensitive data exposure

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenHarness contains a server-side request forgery (SSRF) vulnerability in its web_fetch and web_search tools that allows crafted parameters to direct HTTP requests to internal network locations.

If an attacker can influence an agent session to call these tools with attacker-controlled URLs, they may access localhost, RFC1918, link-local, or other non-public HTTP services and exfiltrate their responses.

Affected context

The vulnerability arises in OpenHarness deployments where agent sessions are allowed to use the web_fetch and web_search tools to perform HTTP requests on behalf of a user or automated workflow.

When these tools accept URLs or hostnames without robust allowlisting or network boundary checks, the application can be tricked into sending requests to loopback (127.0.0.0/8, ::1), RFC1918 private ranges, link-local addresses, or other internal-only endpoints accessible from the host.

This is most pronounced in environments where the OpenHarness host can reach cloud metadata services, internal admin panels, or development APIs that would not normally be exposed to external clients.

Exploit preconditions

  • Attack surface: The web_fetch and web_search tooling interfaces exposed through OpenHarness agent sessions.
  • Required access: Ability to initiate or influence an agent session that can invoke these tools, such as controlling prompts, workflow inputs, or tool parameters.
  • Trigger point: Supplying a crafted URL or network location as a tool parameter that causes the server to issue an HTTP request to a non-public address.
  • Why exploitation is possible: The server-side HTTP client trusts user-controlled destination addresses and does not enforce sufficient validation (e.g., IP range blocking, DNS pinning, or strict allowlists) to prevent requests to internal or local network targets.

Why this happens

This issue is a classic instance of CWE-918: Server-Side Request Forgery (SSRF).

The web_fetch and web_search tools act as HTTP clients running on the server but delegate the choice of target URL or hostname directly to user-influenced input.

Without rigorous filtering of IP ranges, hostnames, and protocols, the tools can be coerced into connecting to network locations that are reachable only from the server's environment.

Conceptually, the insecure pattern is: server_performs_http_request(user_supplied_url) without enforcing network boundary constraints, which lets attackers pivot from the public interface into internal services.

Potential impact

  • Unauthorized access to HTTP responses from localhost-only services (e.g., local development servers, debug endpoints).
  • Retrieval of cloud provider metadata (such as tokens or instance credentials) from metadata services reachable from the host.
  • Discovery and probing of internal network services, including admin panels, monitoring dashboards, or configuration backends.
  • Exposure of sensitive configuration data, API keys, or session tokens returned by internal HTTP endpoints.
  • Facilitation of further attacks such as privilege escalation, lateral movement, or data exfiltration using information obtained via SSRF.

General mitigation guidance

Effective mitigation focuses on treating destination URLs as untrusted input and constraining where server-side tools may connect.

Recommended defensive patterns include:

  • Enforcing strict allowlists of permitted domains or well-defined outbound endpoints for web_fetch and web_search, rather than allowing arbitrary URLs.
  • Implementing robust network-level validation that rejects loopback, link-local, link-local multicast, and RFC1918/private IP ranges after DNS resolution, and re-validates on each redirect.
  • Normalizing and validating URLs before use, including resolving hostnames to IPs and checking against forbidden ranges to prevent DNS rebinding and bypass tricks.
  • Restricting tool capabilities by separating internal-only HTTP clients from public-facing ones and ensuring that untrusted workflows cannot access internal clients.
  • Applying the principle of least privilege at the network layer (e.g., egress filtering, segmented networks) so that the host running OpenHarness has minimal access to sensitive internal HTTP services.
  • Providing secure-by-default tool configurations where network targets are narrowed, and any expansion requires explicit, security-reviewed configuration changes.

How teams detect issues like this

Organizations can detect and monitor SSRF risks in OpenHarness-like tooling through a mix of code-centric and operational approaches:

  • Static analysis: Flag patterns where HTTP client libraries are invoked with user-controllable URLs or hosts, especially within tool or plugin code paths.
  • Code review cues: Look for helper methods that wrap HTTP requests and check whether they enforce domain allowlists, IP range checks, and protocol restrictions; absence of these controls is a warning sign.
  • Policy enforcement: Use secure coding guidelines and CI checks that prevent merging changes introducing new generic "fetch any URL" capabilities without appropriate validation layers.
  • Runtime monitoring: Instrument logging for outbound requests from the application, including destination IPs and hostnames, and create alerts for connections to loopback, link-local, or private ranges.
  • Automated security testing: Incorporate SSRF test cases in dynamic scans and integration tests, attempting to reach known internal-only endpoints (e.g., stubbed metadata services) via the tools.

Sources

SourceLink
github.comgithub.com/HKUDS/OpenHarness/commit/bd4df81f634f8c7cddcc3fdf7f561a13dcbf03ae
github.comgithub.com/HKUDS/OpenHarness/pull/92
vulncheck.comvulncheck.com/advisories/openharness-ssrf-via-web-fetch-and-web-search

Frequently asked

questions

Yes, in typical deployments it can be exploited remotely if an attacker can interact with an OpenHarness agent session that exposes the web_fetch or web_search tools. The attacker does not need direct network access to internal services; the server becomes the proxy.

The attacker must be able to supply or influence the URLs passed to the affected tools. This could be through a normal user account, a multi-tenant workspace, or any untrusted input channel that the agent uses to build tool requests.

The most robust pattern is to restrict these tools to a curated allowlist of external domains and block all private, loopback, and link-local destinations after DNS resolution, combined with strict URL normalization and re-validation on redirects.

Design server-side HTTP utilities with the assumption that destination addresses are untrusted: introduce central URL validation helpers, enforce network boundary checks, apply principle-of-least-privilege to outbound connectivity, and integrate SSRF-specific checks into code review and automated testing.

Find out what's already
exploitable in your codebase.