fix(auth): prevent bootstrap pairing scope changes [AI]#80976
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. from source inspection: current main accepts a same-device bound bootstrap token without checking whether the requested profile changed, and the pairing layer can merge changed pending scopes. I did not run tests because this was a read-only review. Real behavior proof Next step before merge Security Review detailsBest possible solution: Keep the guard at the bootstrap-token verification boundary, preserve generic non-bootstrap pairing supersede behavior, and require maintainer/security review plus real runtime proof before merge. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main accepts a same-device bound bootstrap token without checking whether the requested profile changed, and the pairing layer can merge changed pending scopes. I did not run tests because this was a read-only review. Is this the best way to solve the issue? Yes with maintainer approval: checking the outstanding requested profile in Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ea05be12b4d6. |
|
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:
|
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
N/A
Real behavior proof (required for external PRs)
node scripts/run-vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/device-bootstrap.test.ts src/infra/device-pairing.test.tsTest Files 2 passed (2); Tests 72 passed (72)Root Cause (if applicable)
Regression Test Plan (if applicable)
src/infra/device-bootstrap.test.ts,src/infra/device-pairing.test.tsoperator.readto broader operator scopes until the prior bootstrap use is redeemed, and the pending pairing request remains unchanged.User-visible / Behavior Changes
Bootstrap pairing retries that request a different role or scope set while a previous bootstrap use is pending are rejected. Identical retries remain valid.
Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) YesYes/No) NoYes/No) NoYes/No) YesYes, explain risk + mitigation: bootstrap token records now persist an outstanding requested profile. The added state is limited to roles and scopes already present in the pairing flow, and it is cleared when the matching bootstrap use is redeemed.Repro + Verification
Environment
Steps
node scripts/run-vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/device-bootstrap.test.ts src/infra/device-pairing.test.ts.operator.read.Expected
Actual
Evidence
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