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
The vulnerable code validates only args.path, then runs fs.readdir(validPath, { withFileTypes: true }), builds entryPath = path.join(validPath, entry.name), and calls fs.stat(entryPath).
Expected behavior
Directory listings that claim to operate only inside allowed directories should not follow symlink entries to targets outside the allowed tree. The tool should use lstat, or resolve each entry and enforce the same containment check before reading target metadata.
Actual behavior
A local reproduction created an allowed directory containing a symlink to an external file. The directory-entry metadata path followed the symlink:
allowed directory=/tmp/manual_mcp_filesystem_symlink_metadata_ldkba6qc/allowed
outside target=/tmp/manual_mcp_filesystem_symlink_metadata_ldkba6qc/outside-secret.txt
symlink entry=/tmp/manual_mcp_filesystem_symlink_metadata_ldkba6qc/allowed/leaks-outside-size
os.lstat symlink size=71
os.stat followed target size=39
outside target actual size=39
formatted listing=[FILE] leaks-outside-size 39 B
The reported listing size matches the outside target file size, not the symlink entry metadata.
Before you submit
I searched existing issues and this is not a duplicate.
This is not a security vulnerability report (those go through the private advisory form).
Activity