Skip to content

security(api): routes with no auth beside gated siblings — public /api/redis-service/status, analytics task status and clear-stuck, batch-jobs load/chat-init #18718

Open

Description

@mrveiss

Verified on origin/main 0196c7c234 (umbrella #18717). There is no global user-auth middleware (only service auth), and route_dependencies._BY_ROUTER_NAME covers only chat, so a handler without its own Depends is public.

  • autobot-backend/api/redis_service.py:248 GET /api/redis-service/status: docstring says "No authentication required (public endpoint)". Its siblings stop/start/restart are gated, and the SLM copy is gated at mount (autobot-slm-backend/main.py:708, _SM). Decide whether "public" is intended; if not, gate it.
  • api/analytics.py:1259 GET /dashboard/overview/status/{task_id} and :1273 POST /dashboard/overview/tasks/clear-stuck: no auth; /dashboard/overview/analyze (:1244) has Depends(get_current_user). The report's "5 gated siblings" is wrong: most of the other clear-stuck and status routes are ungated too (code_intelligence.py:2045/2070, codebase_analytics/endpoints/{dependencies,duplicates,import_tree,pattern_analysis}.py); only analytics_bug_prediction.py:931 uses check_admin_permission. Impact is low (clear-stuck is a no-op; status needs a task UUID), but it is a class.
  • api/batch_jobs.py /status (:766), /load (:784), /chat-init (:838): no Depends, while every other route in the file uses get_current_user.

Acceptance criteria

  • Every route above has an explicit auth dependency or is recorded as deliberately public, with the reason, in one place.
  • The task status and clear-stuck routes are gated as a class: one dependency on their routers, not per-handler copies.
  • A guard (router auth enumerator) fails on a new handler with no auth in these routers.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions