Require admin scope for node device token management [AI]#81067
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. source-reproducible: current main routes same-device non-admin node rotate/revoke requests into token mutation, and the scope check accepts empty node scope sets. I did not run a live Gateway repro in this read-only review. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land a maintainer-approved security fix that gates node/non-operator token reactivation behind Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main routes same-device non-admin node rotate/revoke requests into token mutation, and the scope check accepts empty node scope sets. I did not run a live Gateway repro in this read-only review. Is this the best way to solve the issue? Likely yes: the PR gates non-operator role management before token mutation and blocks the local reconnect reactivation path. The merge-ready version should also update protocol docs and include real after-fix proof. Full review comments:
Overall correctness: patch is correct Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 628eeda84ab9. |
|
Not applicable to this automation stage; changelog/release-note and external real behavior proof requirements are handled outside auto-pr stages. Quoted comment from @clawsweeper:
|
…1067) * fix: require admin for node device token management * addressing review-skill * addressing review-skill * addressing review-skill * addressing review-skill * addressing claude review * addressing ci * docs: add changelog entry for PR merge
…1067) * fix: require admin for node device token management * addressing review-skill * addressing review-skill * addressing review-skill * addressing review-skill * addressing claude review * addressing ci * docs: add changelog entry for PR merge
…1067) * fix: require admin for node device token management * addressing review-skill * addressing review-skill * addressing review-skill * addressing review-skill * addressing claude review * addressing ci * docs: add changelog entry for PR merge
…1067) * fix: require admin for node device token management * addressing review-skill * addressing review-skill * addressing review-skill * addressing review-skill * addressing claude review * addressing ci * docs: add changelog entry for PR merge
Summary
device.token.rotateanddevice.token.revokeso non-admin sessions can only manage operator-role device tokens.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
N/A
Real behavior proof (required for external PRs)
src/gateway/server.device-token-rotate-authz.test.tsandsrc/gateway/server-methods/devices.test.ts.Root Cause (if applicable)
Regression Test Plan (if applicable)
src/gateway/server-methods/devices.test.ts;src/gateway/server.device-token-rotate-authz.test.tsUser-visible / Behavior Changes
Non-admin sessions can no longer rotate or revoke node-role device tokens. Admin-authorized management remains available.
Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): YesYes/No): NoYes/No): NoYes/No): YesYes, explain risk + mitigation: Node-role token management is restricted to admin-authorized callers. This narrows token authority without introducing new token material or network behavior.Repro + Verification
Environment
Steps
Expected
device token rotation denied.Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations