Skip to content

[Bug]: link status returns 403 on non-loopback hub management listener #8184

Closed

Description

@oliver-mee

Client or integration

Other: OpenCodex CLI

Area

CLI

Summary

ocx link status returns 403 on a hub whose public listener is bound to a non-loopback address and whose management API uses the dedicated loopback listener. The command should be able to read link status with the local admin credential.

Reproduction

  1. Run a hub with a non-loopback public listener and the dedicated loopback management listener enabled.
  2. Ensure the local admin token is configured and run ocx link status.
  3. The command returns Link management request failed (403). A direct request to the loopback management listener with the admin token also returns 403 with the forbidden code. The request without a token returns 401.

This was observed on 2.96.0 and again after upgrading and restarting on 2.97.0. The proxy itself was healthy.

The likely cause is that trustedLoopbackForIngress does not mark hub-management as trusted, while the link routes require both an admin-token principal and trusted loopback ingress. Those conditions appear incompatible for the local admin request. The same code is present on main at cab7eb7d0332ae0ebb4289d7c6bac1de666b6e40; the live reproduction was on the published package, not a clean source checkout. PR #6913 describes why a management-listener mark alone must not confer trusted-loopback authority, so a fix needs to preserve that boundary for forwarded requests.

Version

2.96.0 and 2.97.0

Operating system

Ubuntu 24.04.5 LTS, Linux arm64

Provider and model

Not applicable.

Logs or error output

Error: Link management request failed (403)

Direct authenticated management response: {"error":{"code":"forbidden","message":"The required link authorization was not present."}}

Screenshots and supporting files

None.

Redacted configuration

Hub role, public listener bound to a non-loopback address, dedicated loopback management listener.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  2. added
    bug
    cli
    proxy
    on Nov 5, 2026
  3. Ingwannu commented on Nov 7, 2026

    @Ingwannu
    Owner

    Confirmed on dev (aaa3c20f3f), and it is the documented boundary, not a regression:

    • trustedLoopbackForIngress returns true only for the unauthenticated loopback listener or a public listener bound to a loopback hostname (src/server/index/serve-options.ts:225-228). Hub-management, hub-link and claude-intercept ingresses are never trusted loopback (structure/remote-link.md:55). The listener mark alone must not grant loopback authority, because a local forwarder such as Tailscale Serve terminates on it.
    • GET /api/link/status uses auth(ctx, "either") (src/server/management/link-routes.ts:269-271). That admits a dashboard session, or an admin token only with trustedLoopbackIngress (src/server/management/link-route-state.ts:85-95). On a hub, the dashboard branch also needs a paired session.

    So ocx link status on a hub with a non-loopback public bind fails with 403 on either listener, even with the local admin token. That leaves the CLI unusable in that topology. Fixing it means deciding which authority should admit a local CLI read on such a hub without letting forwarded requests through: for example, a read-only status exception for the admin-token principal, or a dedicated CLI credential. That is an owner decision. Leaving this open for it. Until then, use a paired dashboard session on the hub to see link status.

  4. jayjay181818 commented on Nov 7, 2026

    @jayjay181818

    Another data point, on Windows and 2.98.0, plus a knock-on effect in GOAT.

    Setup: Windows 11 Pro 10.0.26300, OpenCodex 2.98.0 run by OpenCodex Desktop. runtimeRole hub, hostname 0.0.0.0, unauthenticatedLoopbackListener {enabled:true, port:10102}, hub.managementIngress {enabled:true, port:10101}, with Tailscale Serve in front of 10100 and 10101.

    Same result: ocx link status on the Hub returns Link management request failed (403), with or without the admin token. A paired dashboard session works.

    Why hostname can't be loopback here: with hostname set to the PC's own Tailscale IP, Desktop never started the runtime (ocx resolve's 1500 ms probe times out; I'm filing that separately). 0.0.0.0 is the workaround, so a loopback public listener isn't available in this topology.

    Knock-on effect: GOAT's hub.device_join (joining a machine to the Hub as a Hub client) runs a link-status preflight on the Hub. It fails with "This machine's OpenCodex link status is unavailable", so GOAT can't join devices to a Hub at all until this is decided. A read-only status exception for the local admin token, as suggested above, would unblock it. I'm filing the GOAT side in goat-si/goat.

  5. jayjay181818 commented on Nov 7, 2026

    @jayjay181818
  6. Ingwannu commented on Nov 8, 2026

    @Ingwannu
    Owner

    New information from this report, on top of the analysis above, checked against origin/dev f8dfc2f:

    Still open and owner-owned, as noted above: which authority admits a local CLI read on a hub, without letting forwarded requests through.

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

    bugcliproxy

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions