Symlink swap after validation lets read_text_file return files outside allowedDirectories.
MediumGHSA-p9cv-8g75-4xcg11 Nov · 19 days ago
Does it affect you?
0/4All must holdTicks stay in this browser
Conditions read by Gemini. The sources remain the reference.Maintainer advisory
Timeline
11 Nov18 daysahead of the GitHub database so far
- Published by the maintainer in modelcontextprotocol/servers11 Nov, 07:28 UTC
- Seen by Patchwire +1 min11 Nov, 07:28 UTC
- Not in the GitHub database 18 days later29 Nov, 19:15 UTC
@modelcontextprotocol/server-filesystemafter 2026.8.312.3.0
Versions of @modelcontextprotocol/server-filesystem
2.x
safe 2.3.0
AffectedSafe
Stacks
Not part of a tracked stack.
Related alerts(6)
Same packagesExploitable only if · read by Gemini, the source remains the reference
- Using @modelcontextprotocol/server-filesystem version 2.3.0 or earlier.
- A local process can rename a directory inside an allowed directory.
- An attacker can induce repeated listing calls naming that directory.
- Affected
- @modelcontextprotocol/server-filesystem <2.4.0 · @modelcontextprotocol/server-filesystem >=2025.1.14 <=2026.8.31
- Fixed in
- after 2026.8.31 · 2.4.0
- ID
- GHSA-rq2p-q7c4-6g27
Exploitable only if · read by Gemini, the source remains the reference
- Uses @modelcontextprotocol/server-filesystem (confirmed v2.2.0; other versions not verified).
- The move_file tool is invoked with source and destination on the same device, so the same-device rename path (renameIntoDirectory / fs.renameSync) is used.
- A cooperating local process has write access inside an allowed directory and can swap a parent component of the source path for an outside-pointing symlink.
- The local process wins the race window between the handler's source validation and the rename.
- Server runs on a POSIX host (only the POSIX import form is claimed).
- Affected
- @modelcontextprotocol/server-filesystem <2.3.0 · @modelcontextprotocol/server-filesystem >=2025.1.14 <=2026.8.31
- Fixed in
- after 2026.8.31 · 2.3.0
- ID
- GHSA-7m4x-rv66-mxhh
Exploitable only if · read by Gemini, the source remains the reference
- Project runs @modelcontextprotocol/server-filesystem at a date-versioned release (e.g. 2026.1.14) rather than the fixed 2.0.1.
- The server is configured with an allowed directory.
- A symlink exists inside the allowed directory pointing to a file outside it.
- An attacker can drive calls to the list_directory_with_sizes tool, directly or via prompt injection or repository content.
- Affected
- @modelcontextprotocol/server-filesystem >=2025.7.1 <=2026.8.31 · @modelcontextprotocol/server-filesystem >=1.0.0 <2.0.1
- Fixed in
- after 2026.8.31 · 2.0.1
- ID
- GHSA-hhwq-wxfx-cj7g
Exploitable only if · read by Gemini, the source remains the reference
- Project uses @modelcontextprotocol/server-filesystem (including via the Claude Desktop Filesystem extension).
- The server exposes write file, edit file, create directory, or move file tools on paths whose target file does not yet exist (ENOENT fallback in validatePath).
- A separate local process running as the same user can replace a directory inside allowedDirectories with a symlink pointing outside the allowed tree during the race window.
- Affected
- @modelcontextprotocol/server-filesystem >=2025.1.14 <=2026.8.31 · @modelcontextprotocol/server-filesystem <2.0.1
- Fixed in
- after 2026.8.31 · 2.0.1
- ID
- GHSA-53mr-w429-c597
Exploitable only if · read by Gemini, the source remains the reference
- Uses @modelcontextprotocol/server-filesystem (src/filesystem) at a version before 2.0.1, including date-versioned releases (2025.x, 2026.x).
- The server is configured with allowed directories that restrict filesystem tool access.
- An attacker can influence the path arguments of a filesystem tool (e.g., via prompt injection in content the LLM reads).
- A sibling path of an allowed directory exists, or can be created, whose name ends in a single quote, double quote, or whitespace character.
- Affected
- @modelcontextprotocol/server-filesystem >=2025.8.21 <=2026.8.31 · @modelcontextprotocol/server-filesystem >=1.0.0 <2.0.1
- Fixed in
- after 2026.8.31 · 2.0.1
- ID
- GHSA-7rgq-gccq-qphx
Exploitable only if · read by Gemini, the source remains the reference
- Uses @modelcontextprotocol/server-filesystem version 2026.8.31, 1.0.0 or 2.0.0.
- Allowed directories reside on a case-insensitive file system (e.g. macOS APFS or Windows NTFS defaults).
- An allowed directory contains a symlink that points outside the allowed directories.
- Clients can call create directory, write file or move file with attacker-influenced paths.
- Affected
- @modelcontextprotocol/server-filesystem 2026.8.31 · @modelcontextprotocol/server-filesystem >=1.0.0 <2.0.1
- Fixed in
- after 2026.8.31 · 2.0.1
- ID
- GHSA-4gxg-m5jx-9j57