[WRONG BRANCH] fix(security): require dashboard consent for Codex restart - #371
[WRONG BRANCH] fix(security): require dashboard consent for Codex restart#371luvs01 wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
⏳ DRAFT
What to do
Its title has been prefixed with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d163e5f74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) { | ||
| if ( | ||
| url.pathname === CODEX_RESTART_PATH | ||
| && ctx.principal !== "gui-session" |
There was a problem hiding this comment.
Support Codex restart from remote dashboards
When the proxy uses a non-loopback bind, issueGuiSession returns null (src/server/management-auth.ts:250), so the supported remote dashboard signs in with the raw admin token and managementPrincipal resolves it as admin-token (src/server/management-auth.ts:436-442). This check therefore returns 403 for every restart confirmed in a remote dashboard, permanently breaking its restart control. Provide a consent flow that can grant authenticated remote browsers an appropriate session principal, or explicitly disable the control and document the restriction; the current Web Dashboard and Management API docs still describe remote-token authentication and this endpoint without that limitation.
AGENTS.md reference: AGENTS.md:L300-L301
Useful? React with 👍 / 👎.
Motivation
--yes, which used the raw admin token attached byruntimeRequestand allowed interruption without a dashboard-confirmed GUI session.gui-session), not by an agent-controllable flag.Description
src/server/management/system-routes.tsso POST/api/system/codex-restartreturns HTTP 403 unlessctx.principal === "gui-session".src/cli/system-command.tsand drop the restart entry from the capability index insrc/cli/capabilities.ts.src/server/management/route-registry.ts(exemptionsession-only) and update the exemption type so this rationale is expressible.tests/codex-restart-route.test.tsasserting that callers withadmin-tokenor a missing principal are rejected beforeperformRestartruns and regenerate theskills/ocxsurface reference to reflect the removal of the CLI capability.Testing
./node_modules/bun/bin/bun.exe test tests/codex-restart-route.test.ts tests/cli-capabilities.test.ts tests/cli-dispatch.test.ts tests/skill-ocx.test.ts, which completed with 61 passed and 0 failed../node_modules/bun/bin/bun.exe run skill:surface:checkwhich is current../node_modules/bun/bin/bun.exe run typecheckand ran./node_modules/bun/bin/bun.exe run privacy:scan, both of which passed.bun run testwas attempted but produced unrelated timeouts/failures in the large parallel suite (Lab automation, API-key attribution, server-auth, and other unrelated tests); these failures are pre-existing and not caused by this focused security fix.Codex Task