Skip to content

[V1.4.5] /api/debug/loop is served without the session token #549

Backlog

Description

@AnKiT-GaRG2

GET /api/debug/loop (browser_adapter.py, _debug_loop_handler) returns the loop monitor snapshot, which includes source file paths and stack samples from stalls. It is registered unconditionally, and the only check is the /api Origin/Host guard, so any local process can read it without the session token that /ws needs. The dev-only /api/debug/flood and /api/debug/block are already behind CRAFTBOT_DEBUG_ENDPOINTS=1.

Low severity: it is local only and the Origin/Host guard blocks browser pages from other sites. Suggestion: register it only when CRAFTBOT_DEBUG_ENDPOINTS=1, like the other debug routes, or require the session token.

AI-use note: I used an AI assistant to help trace the code and draft this issue; I checked it myself.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions