Filesystem symlinks leak external file metadata
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Bắt đầu bằng cách tìm phần triển khai list_directory_with_sizes của máy chủ hệ thống tệp và kiểm tra cách hàm tạo đường dẫn cho các mục cũng như đọc siêu dữ liệu. Xem các bài kiểm tra hiện có về danh sách thư mục và liên kết tượng trưng, sau đó tái hiện trường hợp được báo cáo bằng một thư mục được phép có chứa liên kết đến tệp bên ngoài. Hoàn tất khi danh sách không còn để lộ siêu dữ liệu của tệp đích và hành vi này được bao phủ bằng một bài kiểm tra.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Which server?
filesystem (@modelcontextprotocol/server-filesystem)
Server version
0.6.3
How did you run the server?
Not applicable (a repository-level report)
Transport
stdio
Protocol era
Not sure
MCP client and version
n/a
Steps to reproduce
- Start the filesystem server with one allowed directory.
- Create a file outside the allowed directory and a symlink to it inside the allowed directory:
tmp="$(mktemp -d)"
mkdir "$tmp/allowed"
printf 'MCP-FILESYSTEM-SYMLINK-METADATA-MARKER\n' > "$tmp/outside-secret.txt"
ln -s "$tmp/outside-secret.txt" "$tmp/allowed/leaks-outside-size"
- Call the MCP tool for the allowed directory:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_directory_with_sizes",
"arguments": {
"path": "/tmp/example/allowed",
"sortBy": "name"
}
}
}
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).
- Ngôn ngữ chính
- TypeScript
- Star
- 91.4k
- Fork
- 11.8k
- Merge trung bình
- 7 giờ 36 phút
- Pull request đã merge (30 ngày)
- 126
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/servers
-
filesystem: search_files does not expand non-wildcard excludePatterns like directory_tree doesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/servers#5216 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
modelcontextprotocol/servers#5215 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation server-git server-time v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/servers#5213 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation v2
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/servers#5212 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
modelcontextprotocol/servers#5211 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/servers
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
phivk/rubiks-lab#33 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be editedCó thể đã có người làm @ManyaJain111 đã nhận hôm nay. Đang mởbug enhancement possible-duplicate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
AOSSIE-Org/PictoPy#1637 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
chaitin/MonkeyCode#1437 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
rtdb-info-connected-order test: unhandled 'connection is closed' rejection fails the CLI suiteĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cards enhancement migration ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
fil-donadoni/tolaria#6309 ·
Maintainer thường phản hồi trong vòng 1 ngày