FileStore: symlinked parent directories escape the store root
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 4.1k
- フォーク
- 915
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anthropics/anthropic-sdk-python のほかの issue
-
beta_tool validation errors reach the model as "Invalid arguments for function X" with no detail対応中かも @mangeshraut712 が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anthropics/anthropic-sdk-python#2033 · コメント 3 件 ·
-
`AnthropicBedrock` 2.x sends `anthropic_version: 2026-10-21`, which Bedrock rejects for Claude Sonnet 4.5, Opus 4.5 and Opus 4.6対応中かも @charan-rathore が 36 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
anthropics/anthropic-sdk-python#2031 · コメント 1 件 ·
-
Three symlink tests in test_agent_toolset.py are missing the needs_symlinks marker対応中かも @okxint が 82 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
anthropics/anthropic-sdk-python#1915 · コメント 3 件 ·
-
Messages.parse (and AsyncMessages.parse) don't take cache_control?対応中かも @AlphaFDE が 86 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anthropics/anthropic-sdk-python#1907 · コメント 2 件 ·
-
Windows: os.fchmod in credential write-back bricks the OAuth refresh token対応中かも @OllieinCanada が 98 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
anthropics/anthropic-sdk-python#1868 · コメント 1 件 ·
anthropics/anthropic-sdk-python の issue をすべて見る
似ている issue
-
bug harness
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mruangutai/harness#2687 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modal-labs/modal-client#4158 ·
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 72/100
The-Swarm-Corporation/swarms-rs#168 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
linuxserver/docker-healthchecks#137 · コメント 1 件 ·