Malicious repository symlinks escape the clone root during indexing
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
api/config.py の iterate_files から始め、wiki-structure の一覧表示と api/rag/pipeline.py にある呼び出し元を追跡してください。checkout の外部を指すシンボリックリンクを含むリポジトリで動作を検証し、走査とインデックス作成でシンボリックリンクが除外され、そのリンク先を読み取れないことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Affected versions: confirmed on main at commit d92819a9 (the project publishes no tagged release).
Summary
The repository walker used for both the wiki-structure listing and the RAG indexer (iterate_files in api/config.py) follows symlinks: it calls is_file(), which dereferences a symlink, with no is_symlink() guard. A submitted repository containing a symlink pointing outside the checkout (to any file the server process can read) has that symlink listed as a normal file, and the indexer's open() on it dereferences straight to the external target.
Details
for p in Path(root_dir).rglob("*"):
if not p.is_file(): # follows the symlink
continue
...
results.append(os.path.relpath(p, root_dir)...)
# api/rag/pipeline.py
for relative_path in iterate_files(path, ...):
file_path = Path(path) / relative_path
with open(file_path, "r", ...) as f: # dereferences the symlink
content = f.read()
POC
(available upon request)
Impact
A repository author can commit a symlink (with an admitted extension) pointing to a server-readable file outside the checkout. Indexing that repository embeds the target's content into the wiki's RAG store, where it can later be recovered through chat/retrieval.
Suggested fix: skip symlinks during traversal rather than following them. A fix is included in the linked PR.
Fix: #596
- 主要言語
- Python
- スター
- 18.1k
- フォーク
- 2k
- 平均マージ
- 5分
- マージ済み PR(30日)
- 5
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AsyncFuncAI/deepwiki-open のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
AsyncFuncAI/deepwiki-open#608 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AsyncFuncAI/deepwiki-open#539 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
so slowオープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
AsyncFuncAI/deepwiki-open#613 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
AsyncFuncAI/deepwiki-open#610 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
AsyncFuncAI/deepwiki-open#609 ·
メンテナーはふだん 1 日以内に返信
AsyncFuncAI/deepwiki-open の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
FinanceFlash/unvibecode#509 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
FAIRmat-NFDI/nomad-distro-dev#161 ·
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/python-sdk#3821 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug severity:low
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
Log-odds calibration uses upper middle score instead of median for even candidate sets対応中かも @flysheep-ai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信