Skip to content

Own-Ovis offer: the bridge token cannot read /api/access, so a token-gated PC loses its real port and https link #2191

Closed

Description

@devswha

Found while reviewing the fix for #2054.

ownOffer in server/machines.ts (around line 1010) reads GET /api/access on a PC's own Ovis with the bridge token, to learn the port it really answers on (a relayed bridge, #1960) and the https address Tailscale serves it at. The bridge token opens only GET /api/updates and POST /api/updates/install there (server/index.ts, bridgeUpdatePath), not /api/access.

So when that PC's own Ovis needs a token (OVIS_TOKEN set, or anything else that keeps the tunnel from counting as its own loopback), the read always gets a 401. The error is swallowed on purpose ("the address stays the descriptor's"), and the card and dialog then show the descriptor's port and no "Open that PC's Ovis" link, even when that server is relayed or served over https.

This predates #2054's fix; the narrowing did not change it.

Possible directions:

  • let the bridge token read GET /api/access (no query) too, after checking that its answer carries nothing a bridge-token holder should not see; or
  • tell the port and serving address in the descriptor or in GET /api/updates.

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