webapi: add a Host allowlist and Origin/Sec-Fetch-Site checks to the loopback server
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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:
- No Host-header allowlist —
create_appinstalls noTrustedHostMiddlewareor equivalent, so the server answers requests regardless of theHostheader they carry. - No Origin /
Sec-Fetch-Sitevalidation — the CORS middleware (L631-641) only governs preflights and response headers; nothing checks theOriginorSec-Fetch-Siteof 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
Hostis not127.0.0.1[:8799]/localhost[:8799]. - Require
Sec-Fetch-Site: same-origin(or a matchingOrigin) 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.
- Lenguaje dominante
- Python
- Estrellas
- 132
- Forks
- 19
- Merge medio
- 11 h 5 min
- PR fusionados (30 d)
- 2
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/ArgusAgent
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
microsoft/ArgusAgent#31 · 1 comentario ·
Los mantenedores suelen responder en 4 días
Todos los issues de microsoft/ArgusAgent
Issues similares
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
vllm-project/vllm-metal#822 ·
Los mantenedores suelen responder en 1 día
-
vector-store
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
mem0ai/mem0#7461 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
BasedHardware/omi#19047 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día