Skip to content

Rebound public hostnames are header-indistinguishable from local processes #1530

Closed as not planned

Description

@SawyerHood

Problem

The in-app browser's loopback/LAN firewall classifies the URL host string, not the address it resolves to. A public hostname that resolves to a loopback or private address is classified as public and allowed:

// apps/desktop/src/desktop-browser-policy.ts
if (!isLoopbackBrowserRequestHost(parsed.host)) {
  return false; // allowed
}

So a page can reach bb's own loopback services, and any other loopback port, by using a name that resolves to 127.0.0.1. This is pre-existing and already noted as a known residual in that file ("a public name that resolves to a private IP (DNS rebinding) is not caught here").

Why it is worth a ticket now

Reviewing #1522 turned this from a note into a demonstrated bypass. Two things make it sharper than the comment suggests:

  1. http://<public-name> is not a potentially trustworthy URL, so Chromium sends no Sec-Fetch-* headers, and a no-cors GET sends no Origin. A rebound request therefore looks header-identical to a local Node process. Any server-side control that keys on browser headers alone cannot see it.

  2. Reproduced in real Electron against the production browser-view manager, with --host-resolver-rules="MAP rebind.example 127.0.0.1":

    [proxy-stand-in] GET host=rebind.example:41999 guard=ALLOW via=none
    

#1522 mitigated the specific service it exposed — the host daemon's machine-auth proxy now requires its own loopback authority in Host. The general bypass remains for every other loopback service, including the bb server itself.

Suggested work

Not a regression from #1522

Before that change, a rebound public hostname was already allowed by the same branch. #1522 did not widen this path; it widened cross-port loopback for pages that have committed a loopback origin, and reserved bb's own ports there.

AGENT GENERATED: by Claude Opus 5

Activity

  1. SawyerHood commented on Aug 13, 2026

    @SawyerHood
    CollaboratorAuthor

    Reassessment after the approach inverted. Keeping this open, with a smaller and clearer scope.

    The original framing — "DNS rebinding bypasses the in-app browser loopback firewall" — is obsolete: #1537 deletes that firewall outright, deliberately. There is no longer a loopback firewall for rebinding to bypass, so that half of this issue resolves itself by deletion rather than by fix.

    What remains is the part that was always the real concern: a rebound public hostname is header-indistinguishable from a local process, so any control keying on browser headers alone cannot see it.

    What is now covered. The machine-auth proxy (#1536) requires the request Host to be its own loopback authority, so a rebound public name is rejected there. That was the highest-authority service, since it stamps x-bb-connect-machine onto everything it forwards.

    What remains uncovered. The server /api/v1/* guard and the host-daemon local-API guard both key on Origin. Against a rebound name:

    • A rebound mutation sends Origin: http://rebind.example, which is not a trusted origin → rejected. This is the case that matters, and it is covered.
    • A rebound no-cors GET sends no Origin at all, because http://rebind.example is not a potentially trustworthy URL so Chromium also omits Sec-Fetch-* → passes the guard. Reads are unreadable cross-origin, and the GET audit in Guard bb's local HTTP services against foreign browser origins #1536 confirmed no /api/v1/* GET changes durable state, so the practical impact today is nil. It is still a gap in the control rather than in the outcome.

    Suggested remaining work, smaller than the original scope:

    1. Add the same Host authority check to the server and the daemon local API that the machine-auth proxy now has. It is the control that catches what Origin cannot.
    2. The unguessable-capability idea for the proxy URL, carried over from the original write-up. Still the stronger control, still a wider blast radius than any single PR here has warranted.

    Not closing: item 1 above is real, and the "no /api/v1 GET mutates" property that makes it harmless today is a fact about the current routes, not an invariant anything enforces.

    AGENT GENERATED: by Claude Opus 5

  2. changed the title [-]In-app browser: DNS rebinding bypasses the loopback firewall[/-] [+]Rebound public hostnames are header-indistinguishable from local processes[/+] on Aug 13, 2026
  3. SawyerHood commented on Aug 13, 2026

    @SawyerHood
    CollaboratorAuthor

    Closing. This was filed automatically by an agent during the 13 Aug 2026 issue sweep as a follow-up to a pull request. Sawyer is closing the sweep follow-ups rather than carrying them as backlog.

    The analysis above stands on its own and is preserved here. Reopen if it becomes relevant.

    AGENT GENERATED: by Claude Opus 5

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