All vulnerabilities

npm

GHSA-4mfg-r38w-w8fg

mcp-sanitizer: URL sanitizer allows localhost/IPv6 loopback SSRF bypass via explicit port or bracketed IPv6

Severity
High 8.2
Published
28 Oct 2026
Last changed
28 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.4.0
Weakness
Server-side request forgery (CWE-918)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
Sources
OSV.dev and GitHub

Description

mcp-sanitizer v1.3.3 fails to block Server-Side Request Forgery (SSRF) targets when a localhost URL includes an explicit port (e.g., http://localhost:8080/) or when an IPv6 loopback/link-local address is expressed in bracketed notation (e.g., http://[::1]:8080/, http://[fe80::1]:8080/). Because the library is explicitly designed to gate MCP tool parameters such as web_fetch and web_scraper before outbound HTTP requests are made, a bypass here directly enables an attacker-controlled URL to reach internal services, leaking their responses.

The vulnerability exists in src/utils/validation-utils.js inside the validateURLLocation() function that is called by _secureSanitizeURL() in src/sanitizer/mcp-sanitizer.js:698.

The && !parsedUrl.port guard means that any localhost URL that includes a port number is not thrown. http://localhost:8080/ passes the check entirely, returning blocked: false with the original URL preserved.

Bug 2 — Bracketed IPv6 hostname mismatch (lines 272, 293–295):

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
mcp-sanitizernpm · osv:npm:mcp-sanitizer
  • Every version before 1.4.0

About mcp-sanitizer

Weekly downloads (npm)
384npm, 24 Nov 2026

Vulnerabilities in mcp-sanitizer

In our list
2
Published in the last 12 months
2
Critical, last 12 months
0
High, last 12 months
2
Known exploited
0
Search the list for mcp-sanitizer

References