Arbitrary repository URLs enable blind SSRF through Git clone

オープン
#609 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
git, python
領域
backend, security

調査の方向性

Start with _path_is_url and Repo.download() in api/repository.py, then inspect the linked fix in PR #594. The issue says the suggested fix is to reject private, loopback, link-local, and reserved addresses after resolving the host; compare the implementation and its tests against that requirement. Done means caller-supplied URLs cannot make Git clone connect to those addresses.

索引モデルが issue の本文から書いたものです。

説明

Affected versions: confirmed on main at commit d92819a9 (the project publishes no tagged release).

Summary

_path_is_url only checks the URL scheme (http/https/ftp) and that a host is present; it does not constrain the host or resolved address. Repo.download() passes the caller-supplied repo_url straight to GitPython's clone_from, regardless of the labeled repo_type.

Details

# api/repository.py
def _path_is_url(path):
    result = urlparse(path)
    return result.scheme in {"http", "https", "ftp"} and bool(result.netloc)
kwargs = {"remote_url": self.repo_url, ...}
...
_clone_from_github(**kwargs)   # repo_type selects the helper, not the host

A caller can label an internal HTTP endpoint as repo_type=github and have the server's own git clone connect to it.

POC

(available upon request)

Impact

Blind SSRF: the server makes an outbound git clone connection to any host/port the caller supplies, enabling internal service probing and connections to internal-only infrastructure, limited in response visibility to timing/errors and git-protocol-compatible content.

Suggested fix: resolve the host and reject private/loopback/link-local/reserved addresses before connecting. A fix is included in the linked PR.

Fix: #594

主要言語
Python
スター
18.1k
フォーク
2k
平均マージ
1分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AsyncFuncAI/deepwiki-open のほかの issue

AsyncFuncAI/deepwiki-open の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。