Summary
mcp-searxng contains a server-side request forgery vulnerability in its URL-reading capability. An attacker who can influence the requested URL may cause the MCP server to connect to private, loopback, link-local, or cloud-metadata services and return their responses.
The issue is especially risky when the default HTTP interface is reachable by unauthenticated network clients or when tool selection and URL input can be influenced through prompts.
Affected context
The vulnerability occurs in deployments that expose the mcp-searxng URL-reading tool and allow caller-controlled URLs to reach the request function. The hostname check evaluates the literal hostname, while DNS resolution occurs later through the operating system, allowing a public-looking hostname to resolve to an internal destination. Risk depends on network reachability, interface exposure, URL-input controls, and the permissions available to the MCP server.
Exploit preconditions
- Attack surface: The
web_url_readMCP tool and its HTTP or STDIO integration - Required access: An unauthenticated network client in the default HTTP configuration, or the ability to influence tool selection and URL input in a prompt-driven STDIO deployment
- Trigger point: The server performs an outbound fetch after validating the caller-provided hostname
- Why exploitation is possible: Validation is based on the literal hostname rather than the resolved destination address, so DNS can direct an apparently public hostname to a restricted network location
Why this happens
The issue is a server-side request forgery condition caused by validating a URL lexically before resolving and authorizing its destination.
The request path checks the supplied hostname but does not sufficiently verify the resulting IP address after operating-system DNS resolution. A hostname controlled by an attacker can therefore pass the lexical check while resolving to loopback, private, link-local, or cloud-metadata space. This behavior maps to CWE-918: Server-Side Request Forgery (SSRF).
Potential impact
- An attacker may read responses from internal HTTP services.
- Credentials, API keys, or service tokens could be exposed.
- Reachable internal hosts and services may be enumerated.
- Cloud instance metadata or workload identity information could be disclosed.
- Internal administrative interfaces could be accessed through the server's network position.
General mitigation guidance
Mitigation generally focuses on authorizing the resolved network destination rather than trusting the submitted hostname.
Common defensive patterns include:
- Resolve hostnames and reject private, loopback, link-local, multicast, reserved, and cloud-metadata address ranges before connecting.
- Re-check the destination after connection establishment to reduce DNS rebinding risks.
- Prefer explicit outbound destination allowlists over broad URL acceptance.
- Keep private-address access disabled by default and treat any opt-out as a tightly controlled exception.
- Restrict outbound network access from the MCP process using egress policies, firewalls, or sandboxing.
- Require authentication and authorization for HTTP-exposed tools, and minimize the server's network and service-account privileges.
- Avoid returning unrestricted upstream response content when only specific resource types are needed.
How teams detect issues like this
Organizations can identify similar SSRF risks through:
- Static analysis rules for outbound HTTP requests that consume caller-controlled URLs.
- Code review checks comparing validation order with DNS resolution and socket connection behavior.
- Tests covering DNS names that resolve to private, loopback, link-local, and metadata address ranges.
- Egress monitoring for unexpected connections from MCP services to internal address space.
- Proxy, firewall, and DNS policies that alert on restricted-range destinations or unusual external-to-internal resolution patterns.
- Automated security review tools that flag missing post-resolution destination validation.

