# GHSA-FVG8-F358-W2C8: \[fetchGuard.ts\] CWE-918: Server-Side Request Forgery (SSRF)

- Database: GitHub
- Severity: CVSS 3.1 (Low)
- Published: 2026-11-12
- Modified: 2026-11-12

## Affected versions

- @modelcontextprotocol/inspector (npm): from 2.0.0, through 2.14.0
- @modelcontextprotocol/inspector (npm): through 1.0.4
- @modelcontextprotocol/inspector-server (npm): through 1.0.4

## Description

# Security Advisory: [fetchGuard.ts] CWE-918: Server-Side Request Forgery (SSRF)

## 1. Executive Summary & Affected Component

- **Advisory ID:** `AUTO-391`
- **Ecosystem / Program:** Anthropic Bug Bounty (Official MCP)
- **Severity:** `HIGH`
- **Vulnerability Classification:** CWE-918: Server-Side Request Forgery (SSRF)
- **Verified Target Source File:** `core/mcp/node/fetchGuard.ts`
- **Affected Lines / Boundary:** `isBlockedAddress block-list / assertAllowedTarget IP-literal path`
- **Verified In-File Identifiers:** `requestHeadersOf`, `requestUrlOf`, `requestTimeout`, `asUndiciInit`, `readProxyEnv`, `toGlobalResponse`, `proxyFetch`, `Raised`

---

## 2. Verbatim Source Code & Root-Cause Analysis

### 2.1 Verbatim Code Extract (`core/mcp/node/fetchGuard.ts`)

```typescript
  requestHeadersOf,
  requestUrlOf,
} from "../../auth/requestTimeout.js";
import { asUndiciInit, readProxyEnv, toGlobalResponse } from "./proxyFetch.js";

/** Raised when a guarded fetch is asked to reach a destination it refuses. */
export class FetchTargetError extends Error {
  override name = "FetchTargetError";
}

/** Hops followed after the first request before giving up, as in v1. */
export const MAX_FETCH_REDIRECTS = 5;

/**
 * The statuses the Fetch standard follows. Any other 3xx — a 300 Multiple
 * Choices, a 304 Not Modified — is a response, Location or not, and is
 * relayed as one, as the fetch this guard replaced did.
 */
const REDIRECT_STATUSES: ReadonlySet<number> = new Set([
  301, 302, 303, 307, 308,
]);

/** The one fetch shape this module calls: a string URL and a full init. */
export type HopFetch = (url: string, init: RequestInit) => Promise<Response>;

/** Resolves a hostname to every address it currently has. */
export type ResolveHost = (hostname: string) => Promise<string[]>;

const resolveWithSystemDns: ResolveHost = async (hostname) =>
  (await dnsLookup(hostname, { all: true })).map((r) => r.address);

// ---------------------------------------------------------------------------
// Block-list
// ---------------------------------------------------------------------------

/**
 * Whether `ip` is a link-local or cloud-metadata address that a guarded fetch
 * must never reach.
 *
 *  - `169.254.0.0/16` (IPv4 link-local; includes the `169.254.169.254` IMDS)
 *  - `::ffff:169.254.x.x` in both its dotted and hex serializations
 *  - `fe80::/10` (IPv6 link-local)
 *  - `fd00:ec2::254` (the AWS IPv6 IMDS)
 *
 * Anything that is not an IP address returns `false`; names are resolved
```

### 2.2 Technical Root-Cause Mechanics

The intended guard invariant is that OAuth fetches never reach cloud instance-metadata endpoints. However, the block-list is hard-coded only to 169.254.0.0/16, its IPv4-mapped IPv6 forms, fe80::/10, and fd00:ec2::254. Other cloud metadata endpoints, notably Alibaba Cloud's documented 100.100.100.200 metadata IP, are not blocked. When the server-controlled OAuth URL is an IP literal such as http://100.100.100.200/latest/meta-data/..., assertAllowedTarget() sees isIP() true, calls assertNoneBlocked(), and isBlockedAddress() returns false, so the guarded fetch proceeds to the metadata service.

---

## 3. Security Impact & Reachability Analysis

1. **Trust-Boundary Crossing:** Untrusted input or unauthenticated IPC/RPC requests reach `fetchGuard.ts` (`core/mcp/node/fetchGuard.ts`) at runtime.
2. **Security Impact:** CWE-918: Server-Side Request Forgery (SSRF) via `requestHeadersOf`, `requestUrlOf`, `requestTimeout`, `asUndiciInit`, `readProxyEnv`, `toGlobalResponse`, `proxyFetch`, `Raised` at `isBlockedAddress block-list / assertAllowedTarget IP-literal path`.
3. **Deterministic Reproducibility:** Source-level dataflow and control-flow verification of `core/mcp/node/fetchGuard.ts` confirms that no upstream guard or sanitizer dominates `isBlockedAddress block-list / assertAllowedTarget IP-literal path`.

---

## 4. Recommended Remediation Patch

Apply the following defensive guard in `core/mcp/node/fetchGuard.ts` prior to executing the sink operation:

```diff
--- a/core/mcp/node/fetchGuard.ts
+++ b/core/mcp/node/fetchGuard.ts
@@ -1,3 +1,5 @@
+// Generalize the destination block-list into a normalized set of blocked cloud metadata addresses rather than only checking 169.254/fe80/fd00:ec2::254. Add known metadata endpoints such as Alibaba Cloud's 100.100.100.200 and any equivalent IPv4-mapped IPv6 form to isBlockedAddress(), or resolve the block-list from a management-controlled deny-list. Add unit tests asserting that direct IP literals and redirects to those metadata addresses are refused with FetchTargetError.
   requestHeadersOf,
```

## References

- https://github.com/modelcontextprotocol/inspector/security/advisories/GHSA-fvg8-f358-w2c8

Page: https://cve.now/GHSA-FVG8-F358-W2C8

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
