Parent-Directory Fallback TOCTOU in @modelcontextprotocol/server-filesystem Permits Arbitrary File Write Outside allowedDirectories
GHSA-53mr-w429-c597 · published 2026-10-25
- Severity
- Low
- CVSS score
- 2.2
- Chance of exploitation (EPSS)
- No CVE
- Fixed in
- No fix yet
1. Arbitrary file write outside allowedDirectories. Attacker chooses both the destination path (via where the swap symlink points) and the file contents (via the tool argument). On macOS with the default APFS, no integrity protection blocks writes inside $HOME and most of /Users. Concrete misuse targets: ~/Library/LaunchAgents/ .plist (persistence), ~/.zshrc or ~/.bashrc (shell hijack), ~/.ssh/authorized_keys (remote access), the Claude Desktop configuration directory (poison further MCP wiring on next launch). 2. Arbitrary file move via move_file. Any file the server is allowed to read can be renamed across the swapped destination parent into an attacker-chosen directory. …
No fixed release is listed yet for @modelcontextprotocol/server-filesystem. Limit what it can reach, or stop using it until a fix ships, and follow the source advisory for updates.
On Linux and macOS, 2.0.1 anchors each write to the directory it validated, so swapping a parent directory for a symlink between the check and the write is refused. On Windows this is only partly fixed. Node.js resolves every file operation on Windows from a path string rather than from a directory handle, so the server cannot anchor a write to the directory it checked. A directory on the path that is swapped for a junction between the check and the write (creating a junction needs no special privilege) can still redirect write_file, edit_file, create_directory and the destination of move_file outside the allowed directories. …
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| @modelcontextprotocol/server-filesystem | npm | < 2.0.1 | 2.0.1 |
| @modelcontextprotocol/server-filesystem | npm | >= 2025.1.14, <= 2026.8.31 | No fix yet |
2 registered MCP servers install an affected version, by the dependency versions deps.dev resolved for a fresh install. The trace says when.
- io.github.Wolfe-Jam/WJTTC@modelcontextprotocol/server-filesystem@2025.12.18
- one.faf/wjttc@modelcontextprotocol/server-filesystem@2025.12.18
- CriticalMCP Path Traversal Allows Full-Filesystem Read and JWT Secret Exfiltration Leading to Account Takeoverlangflow, langflow-base
- CriticalVibe-Trading FastAPI endpoints permit unauthenticated access, file upload, and an RCE chainvibe-trading-ai
- Critical@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover@zereight/mcp-gitlab
- CriticalFlowise RCE via SQL Database Chain Nodeflowise, flowise-components
- CriticalLangroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file callslangroid
- Criticalfast-mcp-telegram: Bearer token path traversal bypasses reserved Telegram session protectionfast-mcp-telegram
- Highfilesystem: --read-only-dir bypass on case-insensitive Linux mounts@modelcontextprotocol/server-filesystem
- High@modelcontextprotocol/server-filesystem vulnerability allows for path validation bypass via colliding path prefix@modelcontextprotocol/server-filesystem
- High@modelcontextprotocol/server-filesystem allows for path validation bypass via prefix matching and symlink handling@modelcontextprotocol/server-filesystem
- Mediumfilesystem: non-UTF-8 allowed directory resolves to a sibling symlink@modelcontextprotocol/server-filesystem
- Mediumfilesystem: --read-only-dir bypass via move_file and intermediate symlinks@modelcontextprotocol/server-filesystem
- Mediumcreate_directory: NFC-twin symlink race creates dirs in --read-only-dir@modelcontextprotocol/server-filesystem
The impact, patch and workaround text comes from the advisory, shortened (published by the MCP reference servers project). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.