npm
GHSA-7w82-6f9j-v9jp
mcp-sanitizer: File Path Sanitizer Permits Arbitrary User-Home Absolute Paths
- Severity
- High 7.5
- Published
- 28 Oct 2026
- Last changed
- 28 Oct 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 1.4.0
- Weakness
- Path traversal (CWE-22)
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Read data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N- Sources
- OSV.dev and GitHub
Description
mcp-sanitizer v1.3.3 explicitly whitelists /home/ and /Users/ as allowed absolute path prefixes in its file path validation logic (src/utils/validation-utils.js:188-196). As a result, paths such as /home/alice/.ssh/id_rsa and /home/alice/.aws/credentials pass through sanitizer.sanitize() with blocked=false, even though they point to highly sensitive files outside any configured safe root. Any consumer application that trusts the sanitized path and passes it to a filesystem read/write operation (e.g., fs.readFile) will expose arbitrary user-home directory files to an unauthenticated network attacker. Dynamic reproduction confirmed exfiltration of a simulated SSH private key and AWS credentials via a single HTTP POST request.
The vulnerability resides in the validateFilePath function inside src/utils/validation-utils.js. When an absolute path falls outside the configured safe root directories, the function performs a secondary check against a hardcoded allowlist:
Affected software
| Software | Affected versions |
|---|---|
mcp-sanitizernpm · osv:npm:mcp-sanitizer |
|
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
- GHSA-4mfg-r38w-w8fgmcp-sanitizer: URL sanitizer allows localhost/IPv6 loopback SSRF bypass via explicit port or bracketed IPv6High 8.2 28 Oct 2026
References
- GitHub Advisory Database https://github.com/advisories/GHSA-7w82-6f9j-v9jp