Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#32 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api, backend, security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Python
Stelle
137
Fork
23
Merge medio
11h 5m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/ArgusAgent

Tutte le issue di microsoft/ArgusAgent

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.