You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[GHSA-rq2p-q7c4-6g27 follow-up] - filesystem: directory listings are not anchored on Windows #5600
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
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.
Windows: after listing, re-validate the directory and compare its identity (volume serial + file id) before and after, refusing on change.
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.
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
Activity
[-][GHSA-rq2p-q7c4-6g27 follow-up][/-][+][GHSA-rq2p-q7c4-6g27 follow-up] - filesystem: directory listings are not anchored on Windows[/+]