Skip to content

[GHSA-rq2p-q7c4-6g27 follow-up] - filesystem: directory listings are not anchored on Windows #5600

Open

Description

@cliffhall

Follow-up to the fix for GHSA-rq2p-q7c4-6g27, which is published and fixed in v2.5.0.

Problem

The filesystem server's directory-listing tools (list_directory, list_directory_with_sizes, directory_tree, search_files) now list a validated directory in place on macOS and Linux, so a directory swapped after validation cannot redirect the listing. On Windows the anchoring does not hold: the process working directory is a string there and is not read back, and listings have no final-entry check like reads do. Listings on Windows therefore remain exposed to a swap between validation and the read, as content reads on Windows were before.

Separately (usability, not security): the anchored listing refuses a directory the server can read but not enter (read without execute permission). A Linux-only path through /proc/self/fd could list such directories while staying anchored.

Options

  1. Windows: open the directory with a handle that refuses reparse points and list through that handle (native addon or a helper), then compare the handle's final path with the validated path.
  2. Windows: after listing, re-validate the directory and compare its identity (volume serial + file id) before and after, refusing on change.
  3. Linux usability: list read-only-but-not-enterable directories through /proc/self/fd/<n> from an O_DIRECTORY|O_NOFOLLOW descriptor.

Acceptance criteria

  • On Windows, a directory swapped for a link after validation never yields entries from outside the allowed directories, covered by a test that runs on Windows CI.
  • Documentation states the platform coverage accurately.
  • (Optional) On Linux, a directory with read but not execute permission can be listed without reopening the race.

Activity

  1. changed the title [-][GHSA-rq2p-q7c4-6g27 follow-up][/-] [+][GHSA-rq2p-q7c4-6g27 follow-up] - filesystem: directory listings are not anchored on Windows[/+] on Nov 18, 2026
  2. added
    bugSomething isn't working
    server-filesystemReference implementation for the Filesystem MCP server - src/filesystem
    on Nov 18, 2026
  3. added this to the v2.6.0 milestone on Nov 18, 2026
  4. self-assigned this
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingserver-filesystemReference implementation for the Filesystem MCP server - src/filesystemv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions