Rotation reports failure for a rotation that already succeeded #144
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lz/agent-nexus#144
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the
/pr-reviewpass overfeat/mcp.In
_handleRotate(routes/api/auth/rotate-passphrase/+server.ts) the sequence is:sessionCookieOptionsruns after the new wrapper is committed and after every session has been destroyed, and nothing catches it. A throw there produces a 500{"message":"Internal Error"}in the rotation modal while the log saysauth: passphrase rotatedand the new passphrase is already the live one.Measured trigger:
FORCE_SECURE_COOKIE=yesmakescoercethrowexpected bool, got "yes". Any settings-read failure (SQLITE_BUSYon the read microseconds after the committed write) does the same.Operator sees "rotation failed", tries the old passphrase, and is locked out until they work out that the new one is live.
The same shape exists more mildly at
unlock/+server.ts:18-19: a throw betweensessions.create(key)andcookies.set(...)orphans a live-DEK session and the operator cannot log in.Fix
Resolve the cookie options before the irreversible part, or catch around the tail and return a success that names the cookie problem separately. The write must not be able to succeed while the response says it failed.
Related
silent-failure-hunteralso noted that the successful legacy upgrade — a one-time irreversible re-key of every sealed column — is currently unlogged, as are all failed unlocks and both rotation failure paths. Worth folding into the same pass.