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

Open
#8,184 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

Start by reading trustedLoopbackForIngress and the link route authorization checks; the issue points to a conflict between the admin-token principal and trusted loopback ingress. Review PR #6913 for the security boundary around forwarded requests. Reproduce the authenticated request against the dedicated loopback management listener, then verify link status succeeds while forwarded requests still cannot gain trusted-loopback authority from the management-listener mark alone.

Written by the indexing model from the issue text.

Description

bug cli proxy
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.
Dominant language
TypeScript
Stars
16.9k
Forks
1.3k
Avg merge
19h 24m
Merged PRs (30d)
676

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lidge-jun/opencodex

All issues in lidge-jun/opencodex

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.