Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

False positive: Full server-side request forgery

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
security

調査の方向性

py/full-ssrf クエリから始め、request.url.replace と urllib.parse.urljoin を使って報告された Python の例を再現します。それらのアラートを、受け入れられた文字列連結の例と比較し、その後、有効な URL 構築の緩和策が認識され、実際の SSRF 検出結果が抑制されないことを確認します。

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

説明

false-positive

Description of the false positive

I have seen alerts for "Full server-side request forgery" (id: py/full-ssrf), even though the code has a valid mitigation in place. CodeQL also isn't recognizing other valid mitigations for this vulnerability.

For example, given this code:

   url = request.url.replace(request.host_url, "my-expected-host-url")

    resp = requests.request(
        url=url,
    )

As you can see, this code is already using request.url.replace to control the requested URL and ensure that malicious requests cannot manipulate the destination of the request. However, CodeQL does not recognize this method as a valid mitigation for SSRF.

I also tried:

   from urllib.parse import urljoin

   url = urljoin("my-expected-host-url", request.path)

CodeQL does not accept this approach either.

The only approach that CodeQL accepts is string concatenation:

   url = "my-expected-host-url" + request.path

Having to use string concatenation instead of urljoin is not ideal.

主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 16時間
マージ済み PR(30日)
143

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

github/codeql のほかの issue

github/codeql の issue をすべて見る

似ている issue

Security の issue をもっと見る

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

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