Skip to content

Loopback API accepts unauthenticated requests as the user, so any local process can create a "user" turn #4529

Closed as not planned

Description

@pc-style
Written by an agent

Drafted and posted by Claude Code (Claude Opus 5.5) on behalf of @pc-style, from a debugging session on his BB fleet.

Summary

On a BB server, the HTTP API on 127.0.0.1 answers without credentials, and a request with no calling thread is recorded as the user (initiator: "user", senderThreadId: null). Any process on the server machine can therefore write a turn that looks exactly like one the human typed. That includes an agent that unsets BB_THREAD_ID, a plugin's shell-out, or a script. Nothing downstream can tell the difference.

Tested on bb 0.44.0, Linux, server bound to 127.0.0.1:38886, reached remotely through bb Connect.

Reproduction

  1. On the server machine, with no token or cookie:

    curl -s http://127.0.0.1:38886/api/v1/projects
    

    It returns the project list as JSON (HTTP 200).

  2. From a plain shell on the same machine (no BB_THREAD_ID):

    bb thread tell <thread-id> "deploy it"
    

    The target thread's client/turn/requested event has initiator: "user" and senderThreadId: null. That is the same shape as a message typed in the UI. Inside a thread, the CLI marks the sender from the BB_THREAD_ID environment variable, which the process can unset, or set to any other thread's id: BB_THREAD_ID=<another thread> bb thread tell <target> "…" is recorded as sent by that other thread.

Why it matters

Agents are told to act only on their owner's messages, and some tooling relies on "a user turn" meaning "the human said it". In our case, a plugin relays a human instruction to another thread and lets the worker check it against the human's turn. BB's event log can't support that check: it proves a user turn exists, not who wrote it. Prompt-injected agents with shell access are the realistic attacker. They don't need to escape anything, because the server trusts loopback.

This is related to, but narrower than:

Suggested direction

  • Authenticate loopback API requests. For example, the host daemon and CLI read a per-install secret from a file only the BB user can read, and requests without it are rejected. Agent processes get a scoped, per-thread token instead of the install secret.
  • Derive sender attribution from that credential, not from BB_THREAD_ID: a request made with a thread's token is always recorded as that thread (initiator: "agent", senderThreadId set), whatever its environment says.
  • Record where a user turn came from (UI session, CLI with the install secret, plugin id) on client/turn/requested, so plugins can require "typed in the UI" when they need it.
  • Document the current trust boundary: today, loopback equals the user.

Environment

  • bb 0.44.0 (server, CLI and host daemon)
  • Ubuntu on an exe.dev VM; server reached via bb Connect
  • Claude Code 2.1.285 and Codex CLI 0.159.0 threads

AGENT GENERATED

Activity

  1. added theissue type on Sep 30, 2026
  2. added
    security
    host
    on Sep 30, 2026
  3. SawyerHood commented on Oct 19, 2026

    @SawyerHood
    Collaborator

    Consolidated into #3708 at the maintainer's request. Added the source context, evidence links and any distinct/unverified follow-up scope to the canonical tracker: #3708 (comment)

    Closing this report for tracking consolidation, not as fixed. Please continue investigation and updates in #3708; this report remains linked as original evidence.

    AGENT GENERATED

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

    hostsecurity

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions