UTC
Low

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
What it is

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. …

What to do

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. …

Affected
PackageRegistryAffectedFixed in
@modelcontextprotocol/server-filesystemnpm< 2.0.12.0.1
@modelcontextprotocol/server-filesystemnpm>= 2025.1.14, <= 2026.8.31No fix yet
Downstream in the Official MCP Registry

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
See the trace →

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.

Sources: GitHub Advisory Database, reviewed and malware advisories (CC BY 4.0, https://github.com/advisories); advisories published by Cursor (https://github.com/cursor/cursor/security/advisories); advisories published by OpenClaw (https://github.com/openclaw/openclaw/security/advisories); advisories published by vLLM (https://github.com/vllm-project/vllm/security/advisories); advisories published by Open WebUI (https://github.com/open-webui/open-webui/security/advisories); advisories published by n8n (https://github.com/n8n-io/n8n/security/advisories); advisories published by Flowise (https://github.com/FlowiseAI/Flowise/security/advisories); advisories published by Langflow (https://github.com/langflow-ai/langflow/security/advisories); advisories published by the MCP Python SDK project (https://github.com/modelcontextprotocol/python-sdk/security/advisories); advisories published by the MCP reference servers project (https://github.com/modelcontextprotocol/servers/security/advisories); advisories published by the MCP Inspector project (https://github.com/modelcontextprotocol/inspector/security/advisories); advisories published by the MCP TypeScript SDK project (https://github.com/modelcontextprotocol/typescript-sdk/security/advisories); advisories published by the MCP Go SDK project (https://github.com/modelcontextprotocol/go-sdk/security/advisories); advisories published by the MCP Java SDK project (https://github.com/modelcontextprotocol/java-sdk/security/advisories); advisories published by the MCP Kotlin SDK project (https://github.com/modelcontextprotocol/kotlin-sdk/security/advisories); advisories published by the MCP Rust SDK project (https://github.com/modelcontextprotocol/rust-sdk/security/advisories); advisories published by the MCP Ruby SDK project (https://github.com/modelcontextprotocol/ruby-sdk/security/advisories); advisories published by the MCP C# SDK project (https://github.com/modelcontextprotocol/csharp-sdk/security/advisories); advisories published by the MCP PHP SDK project (https://github.com/modelcontextprotocol/php-sdk/security/advisories); advisories published by the MCP Registry project (https://github.com/modelcontextprotocol/registry/security/advisories); advisories published by Open Terminal (https://github.com/open-webui/open-terminal/security/advisories); advisories published by MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-12-06. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].