Skip to content

security: Session API reads and stats /config have no Host check, so DNS rebinding can read prompts #1638

Closed

Description

@huang195

Problem

On a laptop install, a web page can read session content and the runtime config through DNS rebinding.

  • The session API (:47601) checks the Host and Origin headers only on the two DELETE routes (clear.go#L143-L153).
  • Every GET route has no check (server.go#L206-L217). This includes /v1/sessions/{id}, /v1/events and /v1/sessions/{id}/timeline. These routes return raw prompts, completions and tool results.
  • The stats server (:47602) serves /config with no check (statserver.go#L100). redact.JSON removes secrets by key name only, so a secret under an unexpected key name is returned.
  • pprof on the same stats port already refuses a non-loopback Host (pprof.go#L39).

The server sends no CORS headers, so a normal cross-origin read fails. DNS rebinding makes the page same-origin, so that protection does not apply.

Suggested fix

Apply the httpx.LoopbackHost check to every route on both servers when listener.bind_loopback_only is set. The clear guard and pprof use this check already. Cluster deployments are not changed.

Open question

Do API reads also need a token? The Host check closes the browser path. A token also stops other local processes, but agentop must then get the token.

Activity

  1. added
    bug
    laptop
    on Nov 3, 2026
  2. added a commit that references this issue on Nov 3, 2026
    77f6f53
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

    buglaptop

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions