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

webapi: add a Host allowlist and Origin/Sec-Fetch-Site checks to the loopback server

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
api, backend, security

調査の方向性

Start in argus_skill/webapi/server.py at serve() around L712-714 and create_app’s CORS setup around L631-641; compare the desktop token handling in desktop-tauri/src-tauri/src/backend.rs around L920 and the loopback documentation in docs/mobile.md around L112. Define the accepted Host values and non-GET Origin/Sec-Fetch-Site behavior, then verify that unauthorized loopback requests are rejected while allowed requests continue to work.

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

説明

The webapi binds loopback by default (argus_skill/webapi/server.py, serve() at L712-714: host 127.0.0.1, port 8799), and the docs note that this default "needs no token" (docs/mobile.md ~L112). Two standard loopback-server guards are currently absent:

  1. No Host-header allowlist — create_app installs no TrustedHostMiddleware or equivalent, so the server answers requests regardless of the Host header they carry.
  2. No Origin / Sec-Fetch-Site validation — the CORS middleware (L631-641) only governs preflights and response headers; nothing checks the Origin or Sec-Fetch-Site of the requests themselves.

Loopback services without these checks are the classic target of DNS rebinding (a page served from a rebound hostname becomes same-origin to the port) and are reachable by any other local user on multi-user machines, since a loopback bind is machine-global. The desktop host already models the stronger posture — it always sets ARGUS_SKILL_WEB_TOKEN for the web UI it launches (desktop-tauri/src-tauri/src/backend.rs ~L920).

Suggested hardening:

  • Reject requests whose Host is not 127.0.0.1[:8799] / localhost[:8799].
  • Require Sec-Fetch-Site: same-origin (or a matching Origin) on non-GET requests.
  • Optionally, mint a per-run random token for the tokenless loopback mode, as the desktop host already does — this also covers the multi-user-machine case.
主要言語
Python
スター
132
フォーク
19
平均マージ
11時間 5分
マージ済み PR(30日)
2

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

microsoft/ArgusAgent のほかの issue

microsoft/ArgusAgent の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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