UTC
Medium

Symlink swap after validation lets read_text_file return files outside allowedDirectories

GHSA-p9cv-8g75-4xcg · published 2026-11-11

Severity
Medium
CVSS score
4.4
Chance of exploitation (EPSS)
No CVE
Fixed in
No fix yet
What it is

The server returns file contents from outside its configured allowed directories to the MCP client, breaking the boundary the README states ("filesystem operations are restricted to allowed directories"). Where the server runs as a user that can read files that the people able to write the allowed tree cannot, this also crosses an OS-user boundary, as demonstrated above. The attack is a race and needs repeated calls; a single call is not reliable. Suggested CVSS 3.1: AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:N (4.4).

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.

Bind the check to the file actually read: open the final component relative to the pinned, validated parent directory (as pinned-directory.ts already does for writes) with O_NOFOLLOW, confirm the descriptor is the expected regular file, and read through that descriptor. Apply the same to headFile, tailFile and the other read handlers that open by path. A second path-based realpath check would leave another window.

Affected
PackageRegistryAffectedFixed in
@modelcontextprotocol/server-filesystemnpm< 2.3.02.3.0
@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].