Skip to content
PatchBriefing

Search PatchBriefing

Type at least two characters. Results update as you type.

Search CVEs, products, packages and article titles.

Nothing found. Identifiers such as CVE and GHSA can be searched in both languages.

Subscribe

High · 8.2 Node.js & npm GHSA-7w82-6f9j-v9jp GHSA-4mfg-r38w-w8fg

mcp-sanitizer: Two Vulnerabilities Allow Credential Theft and SSRF via Trusted Sanitizer Output

mcp-sanitizer before 1.4.0 contains two flaws: one lets attackers read sensitive files under user home directories by abusing an overly broad path allowlist, and another lets attackers bypass SSRF protections for localhost and IPv6 loopback addresses using ports or bracketed notation. Both are fixed in 1.4.0.

By PatchBriefing ·

Produced automatically from official sources with the help of AI. How we work →

Synthesized by AI from 4 sources · updated 1 week ago

AI summary

Two vulnerabilities have been identified in mcp-sanitizer, a library used to validate file paths and URLs passed to tools in MCP (Model Context Protocol) server deployments. Both issues affect versions prior to 1.4.0 and allow an unauthenticated network attacker to bypass the library's core safety checks, undermining the trust that consuming applications place in its sanitized output. The issues were fixed in version 1.4.0.

What happened

Two separate flaws were identified in mcp-sanitizer's validation logic. The first (GHSA-7w82-6f9j-v9jp) affects the file path sanitizer: it explicitly allows absolute paths beginning with /home/ or /Users/, meaning any path under a user's home directory — including sensitive subdirectories such as .ssh, .aws, .gnupg, .kube, or .config — is returned as 'safe' (blocked=false). The second (GHSA-4mfg-r38w-w8fg) affects the URL sanitizer used to prevent Server-Side Request Forgery (SSRF): URLs targeting localhost or IPv6 loopback/link-local addresses are not blocked when an explicit port is specified, or when the IPv6 address is written in bracketed notation (e.g. with square brackets around it). Both sanitizers are documented to indicate a path or URL is safe to use whenever blocked is false.

Technical cause

In the file path sanitizer, the absolute-path allowlist includes /home/ and /Users/ prefixes without any further restriction on sensitive subdirectories, while the separate dangerous-path denylist only covers directories like /etc/, /proc/, /sys/, /dev/, /root/, /boot/, /usr/bin/, and /sbin/ — it does not check for sensitive home-directory subpaths. In the URL sanitizer, the localhost check only triggers when no port is specified, so adding an explicit port (for example appending a port number to a localhost URL) skips the check entirely. Separately, the link-local and loopback IPv6 checks compare the hostname string directly against values like '::1' and a 'fe80:' prefix, but the URL parser returns IPv6 hostnames wrapped in square brackets, so these string comparisons never match and the restricted addresses are not recognized as such.

Why it matters

mcp-sanitizer is designed to be the security boundary for MCP tools such as file readers/writers and web fetchers that are exposed over a network. Applications integrating it are expected to trust its 'safe' verdict and act on the sanitized value without further checks. Because both bypasses require no authentication and no user interaction, an external attacker can exploit them directly through a single request to a vulnerable deployment. The file path issue has a high confidentiality impact, since it can expose credentials and private keys that would grant further access to other systems. The URL/SSRF issue also carries a high confidentiality impact, since it can expose data from internal services (such as metadata endpoints identified by addresses like 169.254.169.254, admin panels, or other local services) that should not be reachable from outside the host, and a low integrity impact if those internal services accept write operations.

Who is affected

Any deployment that uses mcp-sanitizer versions before 1.4.0 to validate file paths or URLs supplied to MCP tools — for example file_reader, file_writer, web_fetch, or web_scraper style tools exposed through a network-facing MCP server — is potentially affected.

Affected versions

All mcp-sanitizer versions prior to 1.4.0 are affected by both vulnerabilities. Version 1.4.0 contains the fix for both issues.

Fixes and mitigation

Both vulnerabilities are resolved in mcp-sanitizer version 1.4.0. Organizations unable to update immediately should not rely on mcp-sanitizer alone as the sole safety check for file paths or outbound URLs; applications should apply their own independent validation (for example, explicitly denying access to sensitive home-directory subpaths, and independently resolving and checking hostnames/IP addresses before making outbound requests) until the update is applied.

Recommended action

Update mcp-sanitizer to version 1.4.0 as soon as possible in any deployment that exposes file-path or URL-based MCP tools to network input. After updating, verify that previously permitted paths under user home directories and localhost/loopback URLs with explicit ports or bracketed IPv6 notation are now correctly blocked.

PatchBriefing score

8.2 / 10 · High

Official CVSS: 8.2

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N

Why this score

The PatchBriefing score equals the official CVSS score; when this article covers several vulnerabilities, the highest one. Signals such as known exploitation and EPSS are listed separately and do not change the score.

Affected versions

mcp-sanitizer < 1.4.0
vulnerable
mcp-sanitizer ≥ 0 < 1.4.0
vulnerable
≥ 1.4.0
patched
mcp-sanitizer < 1.4.0
vulnerable
mcp-sanitizer ≥ 0 < 1.4.0
vulnerable
≥ 1.4.0
patched

Reported fixes

Both vulnerabilities are resolved in mcp-sanitizer version 1.4.0. Organizations unable to update immediately should not rely on mcp-sanitizer alone as the sole safety check for file paths or outbound URLs; applications should apply their own independent validation (for example, explicitly denying access to sensitive home-directory subpaths, and independently resolving and checking hostnames/IP addresses before making outbound requests) until the update is applied.

How this was built

4 source records were collected, matched and used to prepare the report above.

  • GitHub Advisory Database database
  • GitHub Advisory Database database
  • OSV.dev database
  • OSV.dev database
Unified report
mcp-sanitizer: Two Vulnerabilities Allow Credential Theft and SSRF via Trusted Sanitizer Output
1 article · 4 sources cited
Revision history
  1. Published
  2. Generated
The Morning Brief

Relevant changes for the stacks you follow.

Choose your stacks, topics and optional WordPress plugins. At 07:00 CET, matching advisories and releases from the reporting period are grouped into one email.

✓ Choose stacks and topics✓ Change preferences anytime✓ One grouped email