FileStore: symlinked parent directories escape the store root
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with anthropic/lib/tools/_file_store.py and trace how each listed operation resolves paths beneath the store root; the issue identifies parent symlinks as the gap in the leaf-only O_NOFOLLOW check. Run the reproduction on macOS or Linux and check the FileStore tests for the affected verbs. Done means paths through a symlinked parent raise FileStoreError instead of accessing files outside the root; an open linked pull request is already addressing this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
FileStore paths can escape the root through a symlinked parent
FileStore blocks lexical .. paths and refuses symlinked leaf files, but it doesn't validate symlinked directories in the middle of a path. A pre-existing symlink below the root is enough to read, write, move, or delete files outside the store.
Repro on macOS/Linux:
import os
import tempfile
from pathlib import Path
import anyio
from anthropic.lib.tools._file_store import FileStore
async def repro():
with tempfile.TemporaryDirectory() as td:
base = Path(td)
outside = base / "outside"
outside.mkdir()
(outside / "secret.md").write_text("secret")
store = await FileStore.open(base / "store")
await store.create_root()
os.symlink(outside, store.root().path / "link")
await store.put("link/new.md", "written outside")
assert (outside / "new.md").read_text() == "written outside"
assert await store.get("link/secret.md") == b"secret"
await store.remove("link/secret.md")
assert not (outside / "secret.md").exists()
anyio.run(repro)
Expected: each operation raises FileStoreError, since link/... escapes the confined root.
Actual: the operations follow the symlink and act on the outside directory.
This affects every verb that resolves a path below the root (put, get, ls, find_symlinks, hashtree, hash_file, move, and remove). The leaf-only O_NOFOLLOW check doesn't protect parent components.
- Ngôn ngữ chính
- Python
- Star
- 4.1k
- Fork
- 915
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không 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 anthropics/anthropic-sdk-python
-
beta_tool validation errors reach the model as "Invalid arguments for function X" with no detailCó thể đã có người làm @mangeshraut712 đã nhận 32 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
anthropics/anthropic-sdk-python#2033 · 3 bình luận ·
-
`AnthropicBedrock` 2.x sends `anthropic_version: 2026-10-21`, which Bedrock rejects for Claude Sonnet 4.5, Opus 4.5 and Opus 4.6Có thể đã có người làm @charan-rathore đã nhận 36 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
anthropics/anthropic-sdk-python#2031 · 1 bình luận ·
-
Three symlink tests in test_agent_toolset.py are missing the needs_symlinks markerCó thể đã có người làm @okxint đã nhận 82 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
anthropics/anthropic-sdk-python#1915 · 3 bình luận ·
-
Messages.parse (and AsyncMessages.parse) don't take cache_control?Có thể đã có người làm @AlphaFDE đã nhận 86 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
anthropics/anthropic-sdk-python#1907 · 2 bình luận ·
-
Windows: os.fchmod in credential write-back bricks the OAuth refresh tokenCó thể đã có người làm @OllieinCanada đã nhận 98 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
anthropics/anthropic-sdk-python#1868 · 1 bình luận ·
Tất cả issue của anthropics/anthropic-sdk-python
Issue tương tự
-
bug harness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mruangutai/harness#2687 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modal-labs/modal-client#4158 ·
-
good first issue
Độ khó 1/5 Dưới một 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
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
The-Swarm-Corporation/swarms-rs#168 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
linuxserver/docker-healthchecks#137 · 1 bình luận ·