//nefariousplan

CVE-2026-42260: Open-WebSearch Wrote The IPv6 Block List. The Control Flow Never Reaches It.

vendor

pattern

cve

proof of concept

The pre-patch src/utils/urlSafety.ts in Open-WebSearch contains a defense-in-depth IPv6 deny list. It rejects ::1, the unspecified address, the fc/fd unique-local block, the fe[89ab] link-local block, and the IPv4-mapped form ::ffff:*, where the mapped IPv4 is fed back through a private-range check that already catches 169.254.169.254. Every IPv6 form in the GHSA-v228-72c7-fx8j bypass matrix is named in the source. None of it is ever reached. CVE-2026-42260 is what happens when the function's first action is isIP(hostname), the hostname came from new URL('http://[::1]/').hostname, and Node hands the string back with the brackets still attached.

What the file already knew

In Open-WebSearch 2.1.6, the SSRF defense lives in one function, isPrivateOrLocalHostname(hostname: string) in src/utils/urlSafety.ts. It is called from two upstream paths: from validatePublicWebUrl, the zod refiner installed on the fetchWebContent MCP tool's url argument, and from assertPublicHttpUrl, which fetchWebContent calls again at the request stage and at every final-URL stage after a redirect.

export function isPrivateOrLocalHostname(hostname: string): boolean {
    const host = hostname.trim().toLowerCase();
    if (!host) {
        return true;
    }

    if (host === 'localhost' || host.endsWith('.localhost')) {
        return true;
    }

    if (host === 'metadata.google.internal' || host === 'metadata.azure.internal') {
        return true;
    }

    const integerIp = parseIntegerIpv4Literal(host);
    if (integerIp && isPrivateIpv4(integerIp)) {
        return true;
    }

    if (isPrivateOrLocalIp(host)) {
        return true;
    }

    return false;
}

Read the function's intent before reading its failure. The developer thought about a wide threat surface and wrote the matching block list:

  • localhost and any .localhost subdomain.
  • Two cloud metadata services by name, GCP's metadata.google.internal and Azure's metadata.azure.internal.
  • IPv4 integer literals, so http://2130706433/ is normalized to 127.0.0.1 and rejected.
  • IPv4 dotted via isPrivateIpv4: 10/8, 127/8, 0/8, 100.64/10 CGNAT, 169.254/16 (link-local and AWS IMDS), 172.16/12, 192.168/16, 198.18/15 benchmarking.
  • IPv6 via isPrivateIpv6: ::1 exact, :: exact, ::ffff:* IPv4-mapped (re-validated through isPrivateIpv4, so both ::ffff:7f00:1 and ::ffff:169.254.169.254 would be caught), fc/fd unique-local, and fe[89ab] link-local.

The pre-patch test file backs the inventory up. 127.0.0.1, 10.0.0.5, 192.168.1.1, 169.254.169.254, ::1, fd00::1 are all named in the host-check cases and asserted blocked. http://169.254.169.254/latest/meta-data is named in the URL-check cases and asserted blocked. The developer enumerated AWS IMDS by path, by IP, in writing. The CVE-2026-42260 bypass matrix is twelve URLs. None of them appear in the pre-patch tests. Every one of them sails through.

The first line is the bug

isPrivateOrLocalHostname does several literal-name checks first, then dispatches IP classification through isPrivateOrLocalIp:

function isPrivateOrLocalIp(ip: string): boolean {
    const version = isIP(ip);
    if (version === 4) {
        return isPrivateIpv4(ip);
    }
    if (version === 6) {
        return isPrivateIpv6(ip);
    }
    return false;
}

isIP is node:net's strict IP-literal parser. It returns 4 for a valid dotted IPv4, 6 for a valid IPv6 textual address, and 0 for anything else.

The hostname value passed into the function comes from upstream:

export function isPublicHttpUrl(url: string): boolean {
    try {
        const parsed = new URL(url);
        if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
            return false;
        }
        return !isPrivateOrLocalHostname(parsed.hostname);
    } catch {
        return false;
    }
}

What is new URL('http://[::1]/').hostname? The WHATWG URL spec, which Node implements, defines the hostname of a URL whose host is an IPv6 literal as the bracketed textual address. Node hands back '[::1]'. With the brackets.

> new URL('http://[::1]/').hostname
'[::1]'
> isIP('[::1]')
0
> isIP('::1')
6

When the URL host is [::1], the control flow inside isPrivateOrLocalIp resolves to:

  1. version = isIP('[::1]') = 0
  2. version === 4 is false
  3. version === 6 is false
  4. return false

isPrivateIpv6 is never called. The ::1 exact branch, the :: exact branch, the ::ffff:* IPv4-mapped branch, the fc/fd unique-local branch, the fe[89ab] link-local branch, none of that code runs for any URL whose host is given in bracketed IPv6 form. The block list is in the file. The control flow does not reach it.

Every URL in the CVE-2026-42260 bypass matrix shares this property:

http://[::1]/
http://[::]/
http://[::ffff:127.0.0.1]/
http://[::ffff:7f00:1]/
http://[0:0:0:0:0:ffff:127.0.0.1]/
http://[0:0:0:0:0:0:0:1]/
http://[::0:1]/
http://[0:0::1]/
http://[::ffff:a00:1]/
http://[::ffff:c0a8:1]/
http://[::ffff:a9fe:1]/
http://[::ffff:169.254.169.254]/latest/meta-data

Each one is dispatched through isIP, returns 0, and the gate concludes "public."

Node's HTTP client does not have this problem. When axios.get('http://[::ffff:169.254.169.254]/latest/meta-data') reaches the socket layer, the address is parsed by the Node net stack, which understands IPv6 textual form and the IPv4-mapped representation. On a Linux host with the dual stack enabled, which is the default on every cloud Linux distribution, the kernel recognizes the ::ffff: mapped form and dials the IPv4 endpoint 169.254.169.254. AWS IMDSv1 replies. The response body is returned to the caller of the MCP tool.

The hostname-string deny-list and the connection's address parser are reading different things. The deny-list reads [::ffff:169.254.169.254], decides it is not an IP, decides it is therefore not private, lets it through. The connection reads ::ffff:169.254.169.254, recognizes it as the IPv4-mapped form, dials 169.254.169.254. The two layers disagree about what the bytes said. Between the disagreement is the SSRF.

DNS is the second leg of the bypass

The advisory names a second class of bypass. isPrivateOrLocalHostname looks at the hostname literal. It does not resolve DNS. An attacker who controls attacker.example and points its A record at 127.0.0.1, or its AAAA at ::1, sails through every check the function performs: it is not localhost, it is not on the two-entry metadata-internal list, it does not parse as an integer IP, isIP('attacker.example') returns 0. The function returns false. The URL is "public."

axios.get('http://attacker.example/') triggers DNS resolution. The resolver returns the attacker-chosen private address. Node's HTTP client dials it. The MCP tool retrieves the loopback service and returns the body.

The pre-flight validator inspects the form before resolution. The connection performs the resolution. Both layers do their job correctly in isolation, and the boundary between them does not exist.

Who the caller is

Open-WebSearch is an MCP server. The HTTP transport binds 0.0.0.0:3000 by default; MODE=both (HTTP plus stdio) is the out-of-the-box configuration. The README states that no API keys or authentication are required. The Docker quick-start example runs with ENABLE_CORS=true -e CORS_ORIGIN=*.

The fetchWebContent tool's argument schema runs isPublicHttpUrl as a zod refinement. That refinement is the only gate between the caller and axios.get against an arbitrary URL whose response body becomes the tool's return value.

The intended caller is not a human attacker typing URLs. The intended caller is an LLM agent. The agent fetches a webpage on the operator's behalf: a search result link, a URL the operator pasted, a URL another tool produced. The webpage may contain prompt-injection content instructing the agent to fetch a follow-up URL.

The agent does not need to understand the bypass. It needs only to be persuaded to call:

fetchWebContent({ url: "http://[::ffff:169.254.169.254]/latest/meta-data/iam/security-credentials/" })

The MCP server, sitting on the operator's cloud instance, performs the request from its own network position. The instance metadata service responds. The agent receives the response body, IAM role credentials included. The next prompt-injection step in the webpage tells the agent to forward those credentials to an attacker-controlled URL through, again, fetchWebContent.

This is non-blind SSRF, scoped to whatever the operator's network position can reach. The HTTP transport, the agent's prompt-injection susceptibility, and the missing bracket strip compose into "the LLM exfiltrates the host's cloud credentials." Each component is held by a different party. None of the parties are individually wrong about anything they own.

The same disease, in a different organ

The pattern is gate-before-canonicalize, applied to hostnames rather than paths. A security check inspects an input for a forbidden form. A downstream subsystem canonicalizes the same input, strips brackets, resolves DNS, unwraps the IPv4-mapped form to its IPv4 endpoint, into that forbidden form. The check sees the wrapped representation. The action sees the unwrapped one.

The closest sibling is CVE-2026-42596 in Gotenberg, the same disease in Go. Gotenberg's default deny-list regex byte-matches against the URL host. [::ffff:127.0.0.1] does not appear in any character class of the regex; net/netip.ParseAddr unmaps it to 127.0.0.1 at dial time. The regex sees the wrapped form, the dial sees the unwrapped one. The same gap, in the same direction, on a different language stack.

Open-WebSearch's variant is sharper in one direction. Gotenberg's regex was never written to match the IPv4-mapped IPv6 form; the deny-list author did not enumerate that form. Open-WebSearch's isPrivateIpv6 was written to match it, with explicit logic that strips the ::ffff: prefix and feeds the trailing IPv4 through the existing IPv4 private-range check. The branch is in the source. It is unreachable because the dispatcher's first action is a strict IP parser that rejects the bracketed form the URL parser produced.

CVE-2025-41242 in Spring, CVE-2026-26336 in Alfresco, and CVE-2026-42882 in s3-proxy all cleave at the same joint. A defender's parse and an actor's parse disagreed about what the bytes said.

What the patch admits

The fix for CVE-2026-42260 in commit 8c35c6b lands the bracket strip in two lines:

 export function isPrivateOrLocalHostname(hostname: string): boolean {
-    const host = hostname.trim().toLowerCase();
-    if (!host) {
-        return true;
-    }
-
-    if (host === 'localhost' || host.endsWith('.localhost')) {
+    const raw = hostname.trim().toLowerCase();
+    const host = raw.startsWith('[') && raw.endsWith(']') ? raw.slice(1, -1) : raw;
+    if (!host || host === 'localhost' || host.endsWith('.localhost')) {
         return true;
     }

After the strip, the patch replaces the hand-rolled isPrivateIpv6 and isPrivateIpv4 with ipaddr.js's range() classifier. range() returns 'unicast' for public addresses and one of 'loopback', 'private', 'linkLocal', 'uniqueLocal', 'ipv4Mapped', 'reserved', 'multicast', 'broadcast', 'unspecified' for not-public. The custom enumeration is replaced by a library enum that someone else maintains.

Then comes the comment.

// Fast-path only. The authoritative SSRF boundary is request-filtering-agent
// in src/utils/httpRequest.ts, which re-validates at connect time.
export function isPrivateOrLocalHostname(hostname: string): boolean {

The function that used to be the gate is now annotated as a fast-path. The new boundary is in httpRequest.ts. The same commit removes the standalone directHttpsAgent from that file entirely, replacing it with RequestFilteringHttpAgent and RequestFilteringHttpsAgent from the request-filtering-agent package. Every outbound axios request that is not going through a configured outbound proxy now routes through these filtering agents:

-import https from 'node:https';
 import { HttpsProxyAgent } from 'https-proxy-agent';
+import {
+    RequestFilteringHttpAgent,
+    RequestFilteringHttpsAgent
+} from 'request-filtering-agent';
...
-        requestOptions.httpsAgent = getDirectHttpsAgent(allowInsecureTls);
+        requestOptions.httpAgent = getFilteringHttpAgent();
+        requestOptions.httpsAgent = getFilteringHttpsAgent(allowInsecureTls);

The filtering agents hook the socket's lookup and connect callbacks. They see the resolved IP literal the socket is about to dial, after DNS, after IPv4-mapped unwrap, after every transform the kernel applies between hostname and packet. The boundary moved to the place where there is only one representation left.

The string-based isPrivateOrLocalHostname survives in the source, with its block list intact, now correctly described in a comment as a fast-path optimization rather than an enforcement layer. The patch does not delete the function. It demotes it.

The block list is not the lesson

The developer wrote a deny-list with every IPv6 form named, named cloud metadata services by hostname, named AWS IMDS by IP literal and by URL path, and shipped a test suite that asserted each named form was blocked. The deny-list is comprehensive against the forms the developer enumerated. The bug is not in the enumeration.

The bug is that a deny-list applied to a hostname string is applied to one of the many representations the address has. The kernel, the URL parser, the DNS resolver, and the IP-literal parser disagree about which representation they are reading. new URL keeps the brackets. node:net.isIP rejects the brackets. axios.get strips the brackets and dials the address inside them. The connection's parser is more permissive than the gate's parser, and the gap is the SSRF.

The structural fix is to put the check where there is only one representation left. The patch does that. It leaves the gate's parse in place, annotated, and adds the actor's parse as the new boundary. The same advisory that named twelve bracketed bypasses also names DNS rebinding; the connect-time check catches both with one mechanism.

PoC and disclosure: GHSA-v228-72c7-fx8j. Patched in 2.1.7, commit 8c35c6b. Reported by Shmulik Cohen at Apiiro.

The pre-flight validator is still in the file. The comment above it now says it is not the boundary.