Repository navigation
web: ask for a fresh code when a step-up window has passed (§7.3 rule 6) - #28
Conversation
A privileged action refused with 403 stepup_stale now opens a dialog for an authenticator code, refreshes the step-up through /api/auth/stepup/totp and sends the action once more; cancelling returns the refusal. Any other 403 is untouched. web/dist rebuilt with Node 26 (CI's NODE_VERSION). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process: ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪🧪 PR contains tests⚡ No major issues detectedAdvisory only: this comment never gates the pull request. |
Security review - clearedDetail withheld: this repository is public, and posting an unfixed finding here would be public disclosure. The full report was posted to the hand-off board at https://myslop.urlxl.us/f/pr-reviewer-busnes-app-kyguard-server-28, where it is readable by the operator and expires seven days after the last post.
gpt-6.1-sol using security-audit on behalf of Yoshi |
Autonomous review - 1/1 personas cleared
Merging remains a human decision; this bot never approves. gpt-6.1-sol using security-audit on behalf of Yoshi |
PR Reviewer Guide: a second stale refusal replaced the first waiter, so the first action never settled, and unmounting the shell with the prompt open left its caller pending. Concurrent refusals now share one dialog and all resolve with its answer; unmounting resolves them as cancelled (the original 403). web/dist rebuilt with Node 26. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Guide (lost requests; unresolved cancellation) fixed in 8e9b4b9: concurrent |
PR Reviewer Guide: a transport failure on the code request now shows a retryable error instead of escaping, and while open the dialog makes the shell behind it inert and gives focus back on close. web/dist rebuilt with Node 26. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Guide (unhandled failure; modal focus) fixed in 69b74b0: a transport error on the code request shows a retryable error in the dialog, and while open the dialog marks the shell behind it |
…) into kyguard/web-restepup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
secureFetch checked the registered ReStepUp prompt before reading the 403 body. If the shell unmounted while the body was being parsed, the prompt was null by the time it was called, and the action rejected with a TypeError instead of receiving its 403. It now takes the prompt after the body is read and returns the refusal when there is none (PR Reviewer Guide, "Unmount race"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picks up the stack's merge commits as pushed. No content change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cancel stayed disabled while the code check was in flight, so a stalled request left the shell inert with no way out. Cancel is now always enabled and aborts the in-flight check; an aborted check shows no error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #17's blocked-enrollment notification fix up. web/dist rebuilt from the merged sources with Node 26.13.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cancelled check whose refusal body arrived late could clear the next prompt's code, show its error and re-enable Confirm mid-check. Each submission now changes the dialog only while it is still the current one, and cancelling resets busy itself. web/dist rebuilt (Node 26.13.1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A passive effect set inert after the dialog was already in the DOM: a brief window where the shell behind stayed usable, and a CI flake in the inert test. A layout effect applies it in the same commit. web/dist rebuilt (Node 26.13.1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merger (saltmarsh-merge): closing and reopening right away so CodeQL runs now that the base is |
Inert keeps focus off the shell behind the dialog, but Tab from Cancel (or Shift+Tab from the code input) still left the page for the browser chrome. The dialog now wraps focus at its first and last controls. Fixes the PR Reviewer Guide's "Focus trap" note on #28. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fixed the Guide's Focus trap note in 67b6acd. The dialog now wraps Tab at Cancel and Shift+Tab at the code input. |
In one line: When a privileged action is refused because its five-minute step-up window has passed, the web shell now asks for an authenticator code and sends the action again, instead of only showing the error.
What changed
secureFetchrecognizes a 403stepup_staleand asks the shell for a code through one registered prompt.ReStepUpdialog posts the code to/api/auth/stepup/totp. On success the original request is sent once more; on cancel the caller gets the 403 as before.web/distrebuilt with Node 26 (CI'sNODE_VERSION).Review this
web/src/api.ts: the retry. It runs once, and only forstepup_stale.web/dist(generated; CI's dist check covers it).Checked:
npm test(46 tests),npm run build(dist matches; the base rebuilt byte-identical with this toolchain first),npm run audit(0 vulnerabilities),npm run test:browser(8 passed, 4 skipped by the spec's own conditions) on Major, Node 26.13.1. Two mutations fail their tests (below).Not checked: the Go suite at this head. Its Go code is identical to #27's head, which passed race and FIPS on both drivers; only
web/distdiffers.You need to: review. Held unmerged by rule.
§13 Phase 0: the web half of per-action step-up (§7.3 rule 6), left over from #17/#18.
Review fix (8e9b4b9): concurrent stale refusals share one dialog and all hear its answer; unmounting with the prompt open resolves them as cancelled (Guide). Re-checked at 8e9b4b9: 48 unit tests, build, audit, browser suite (8 passed, 4 skipped).
Review fix, round 2: a lost connection on the code request shows a retryable error, and the open dialog makes the shell inert and returns focus on close (Guide). Re-checked at this head: 50 unit tests, build, audit, browser suite (8 passed, 4 skipped).
Detail
Mutation table
asks for a fresh code on stepup_stale and sends the action againstepup_stalepromptsdoes not prompt for any other 403answers every action refused while the prompt was openreturns the refusal when the shell goes away with the prompt openshows a retryable error when the server cannot be reachedinertkeeps the shell inert while open and gives focus back on closeStack
… → #26 → #27 → this.
Review fix, round 3 (hawthorn fix-auth-3): the shell unmounting while a 403 body is still being read no longer throws a
TypeError:secureFetchtakes the registered prompt after parsing, and with none it returns the 403 (Guide, "Unmount race"). This head also mergeskyguard/cli-login, which carries #7's fail-closed SSO sign-in up the stack; that merge clears this PR's conflict.returns the refusal when the shell goes away while the refusal is being read(TypeError: reStepUp is not a function)Re-checked at this head on Major, Node 26.13.1: 51 unit tests,
npm run build(committed dist matches),npm run audit(0 vulnerabilities),npm run test:browser(8 passed, 4 skipped by viewport),make smoke,make notes-check,make tidy-check,reuse lint. Go suite: race and FIPS suites, PostgreSQL 17 on k80 (14/14 packages, exit 0) and SQLite on Major (every K host was busy; exit 0).Round 4 (hawthorn): stack merged up from main
kyguard/cli-login, bringing main into the stack along with auth: pending SSO sessions and TOTP step-up (§7.3) #17's step-up retry, api: classified route registry and per-action step-up (§7.5, §7.3 rule 6) #18's stage check and backup: durable intents for pairing, pin and deposit (§9.3) #25's intent fixes. The sources merged cleanly. The only conflict was the hashedweb/distbundle, soweb/distwas rebuilt from the merged sources with Node 26.13.1.npm ci, build, unit 52/52 andnpm run audit(0 vulnerabilities), all on Node 26.13.1. Then gofmt,go vet, andgo test -race -count=1 -p 2 ./...plus the same underGODEBUG=fips140=on: SQLite passed (k80, exit 0) and PostgreSQL 17 passed (Major, own postgres:17-alpine container, exit 0). I did not run the browser (Playwright) suite locally this round; CI runs it.Round 4b (hawthorn): Guide "Blocked cancellation"
/api/auth/stepup/totpcheck through anAbortController, and an aborted check shows no error. A stalled request therefore cannot leave the shell inert.ReStepUp.tsx(Cancel disabled while busy, no abort)ReStepUp.test.tsx"cancels a stalled code check"Checks at 6f23507: web build, unit 54/54 and audit (0 vulnerabilities), all on Node 26.13.1. Go code is unchanged since f018d93, whose race + FIPS suites passed on SQLite (k80) and PostgreSQL 17 (own container).
Round 4c (hawthorn): Guide "Cancellation race"
busyitself. A cancelled check that finishes late therefore cannot touch a prompt opened after it.ReStepUp.tsxbusy)Checks at this head: web build, unit 55/55 and audit (0 vulnerabilities), all on Node 26.13.1. Go code is unchanged since f018d93; its race + FIPS suites passed on SQLite (k80) and PostgreSQL 17 (own container).
Round 4d (hawthorn): CI flake in the inert test
keeps the shell inert while open and gives focus back on close(origin.inertundefined).inertwas set in a passiveuseEffect, which can run after the dialog is already in the DOM. That leaves a short window where the shell behind is still usable, and a race in the test. It is now auseLayoutEffect, soinertis applied in the same commit that shows the dialog.Round 4e (hawthorn): main (#8) merged up
kyguard/cli-login, bringing main with Broker listener, CA and pairing (§4.1) #8 and the join fixes in store: chained audit append on both drivers (§9.3) #19, backup: durable intents for pairing, pin and deposit (§9.3) #25 and backup: broker CA in the capsule; restore clears every credential (§9.4) #26. No web change. Race + FIPS at 0cb6d83: SQLite pass (k82, exit 0), PostgreSQL 17 pass (Major, own container, exit 0).Round 6 (hawthorn): main (#11) merged up; Guide "Focus trap"
origin/main(37b302b, through Broker journal and rotation state machine (§4.2, §4.3, §4.6) #11). It merged cleanly, with no web change from main.inertkept focus off the shell but not out of the browser chrome. The dialog now handles Tab on its last control (Cancel) and Shift+Tab on its first (the code input) by moving focus to the other end. Focus moves between those two normally.web/distwas rebuilt with Node 26.13.1.onKeyDown={wrapTab}ReStepUp.test.tsx"wraps Tab and Shift+Tab inside the dialog"The Chromium check is not committed. No route in Phase 1A has a step-up window yet, so the only way to reach the dialog is to stub one
stepup_stalerefusal (page.route), andweb/browser/AGENTS.mdbars mocked responses in that suite. The unit test is the committed regression.Checks at 67b6acd (Node 26.13.1): unit 56/56,
npm run build(committed dist matches),npm run audit(0 vulnerabilities). The Go code is unchanged from dbb8d5d, where gofmt,go vet, andgo test -race -count=1 -p 2 ./...plus the same underGODEBUG=fips140=onpassed: SQLite on Major (every K host was busy; exit 0) and PostgreSQL 17 on k80 (exit 0). The full Playwright suite was not run locally this round; CI runs it.🤖 Generated with Claude Code