vulnerableVerifiedAGT-2026-0146
mcp-searxng: SearXNG MCP Server: DNS-resolved Private Hostname SSRF in `web_url_read`
A real bug in otherwise honest software. Check your version against the affected range below.
GHSA-mrvx-jmjw-vggc · CVE-2026-58485
DNS-resolved Private Hostname SSRF in `web_url_read`
Summary
The `web_url_read` MCP tool in `mcp-searxng` is vulnerable to Server-Side Request Forgery (SSRF) via DNS rebinding bypass. The `assertUrlAllowed()` function at `src/url-reader.ts:85-93` validates only the syntactic hostname string against a private IP/hostname blocklist without performing DNS resolution. An attacker who controls a domain that resolves to a private or loopback IP address (e.g., via a wildcard DNS service like `nip.io`, or a custom DNS entry) can bypass the security check and cause the MCP server to read arbitrary internal HTTP services reachable from the server host. This allows exfiltration of sensitive data from internal services with no authentication required in the default HTTP configuration.
Details
The vulnerable code is in `src/url-reader.ts`, where the `assertUrlAllowed()` function performs a hostname-only string comparison:
```ts // src/url-reader.ts:85-93 function assertUrlAllowed(url: URL): void { const security = getHttpSecurityConfig(); if (security.allowPrivateUrls) { return; }
if (isPrivateHostname(url.hostname) || isPrivateIpv4(url.hostname) || isPrivateIPv6(url.hostname)) { throw createURLSecurityPolicyError(url.toString()); } } ```
This function checks whether `url.hostname` lexically matches a private address pattern but never resolves the hostname via DNS. The OS-level DNS resolution happens later, inside `undiciFetch()` at `src/url-reader.ts:367`, after the security gate has already passed.
The full data flow is:
- `src/index.ts:37-49` — `isWebUrlReadArgs()` accepts `args.url` as any string value with no URL policy enforcement.
- `src/index.ts:226-240` — `web_url_read` passes `args.url` directly to `fetchAndConvertToMarkdown()`.
- `src/url-reader.ts:307-313` — URL is parsed and `assertUrlAllowed(parsedUrl)` is called (string check only).
- `src/url-reader.ts:85-93` — `assertUrlAllowed()` checks `url.hostname` as a string; no DNS resolution is performed.
- `src/url-reader.ts:367` — `undiciFetch(currentUrl.toString(), currentRequestOptions)` resolves the hostname via OS DNS and connects to the resolved IP, which may be a private or loopback address.
In the default HTTP mode (`MCP_HTTP_HARDEN` unset), `requireAuth` is `false` (see `src/http-security.ts:30-41`), meaning no authentication is required to invoke `web_url_read`.
The recommended remediation is to resolve the hostname via `node:dns/promises` inside `assertUrlAllowed()` before the fetch is issued:
```diff --- a/src/url-reader.ts +++ b/src/url-reader.ts @@ import { isIP } from "node:net"; +import { lookup } from "node:dns/promises"; @@ -function assertUrlAllowed(url: URL): void { +async function assertUrlAllowed(url: URL): Promise<void> { const security = getHttpSecurityConfig(); if (security.allowPrivateUrls) { return; } + if (!["http:", "https:"].includes(url.protocol)) { + throw createURLSecurityPolicyError(url.toString()); + }
if (isPrivateHostname(url.hostname) || isPrivateIpv4(url.hostname) || isPrivateIPv6(url.hostname)) { throw createURLSecurityPolicyError(url.toString()); } + if (isIP(url.hostname) === 0) { + const answers = await lookup(url.hostname, { all: true, verbatim: true }); + if (answers.some(({ address }) => isPrivateIpv4(address) || isPrivateIPv6(address))) { + throw createURLSecurityPolicyError(url.toString()); + } + } } @@ - assertUrlAllowed(parsedUrl); + await assertUrlAllowed(parsedUrl); @@ - assertUrlAllowed(nextUrl); + await assertUrlAllowed(nextUrl); ```
PoC
**Prerequisites:**
- Docker installed on the test machine. - The `mcp-searxng` repository cloned locally (version 1.6.0 / commit `90423e5`).
**Build the container:**
```bash docker build -t mcp-searxng-ssrf-001 -f vuln-001/Dockerfile . ```
**Run the PoC:**
```bash docker run --rm \ --add-host ssrf-target.internal:127.0.0.1 \ -v $(pwd)/vuln-001/poc.py:/poc.py \ mcp-sear
Imported from OSV GHSA-mrvx-jmjw-vggc.
Affected
- npm:mcp-searxng
- < 1.7.1 (fixed in 1.7.1)
Field marks
- Kind
- mcp server
- Reported by
- osv-import
Sources
- osv.dev https://osv.dev/vulnerability/GHSA-mrvx-jmjw-vggc
- github.com https://github.com/ihor-sokoliuk/mcp-searxng/security/advisories/GHS…
- github.com https://github.com/ihor-sokoliuk/mcp-searxng
Wrong or outdated? Open an issue or PR against corpus/entries/AGT-2026-0146.json.