Repository navigation
fix(server): keep account closure going past one bad grant or request - #868
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
From the v0.74.0 security review: - LookupBackchannelInteraction answered a backchannel store outage as an unknown handle, so ListBackchannelInteractions showed an empty inbox and DenyBackchannelInteractions reported (0, nil) during one. An outage is now server_error, and a request whose client is no longer registered unauthorized_client, as LookupInteraction answers. - One bad entry failed the whole listing, and with it RevokeSubjectGrants and DenyBackchannelInteractions, for as long as it lived: an unreadable record, or a pending request from a deregistered client. A deregistered client's request now leaves the inbox. RevokeSubjectGrants and DenyBackchannelInteractions act on every readable entry and carry on past one that fails, then report every failure; RevokeListedGrant revokes a readable grant whatever the others' state. ListGrants and ListBackchannelInteractions still fail on an unreadable entry rather than hide it. - Reusing an authorization code now also removes its grant from the registry, and DenyBackchannelInteractions clears an entry whose request it finds already decided. - A grant entry whose refresh token hash doesn't derive its key, or an inbox entry whose request is bound to another subject than the one it's filed under (as a database writer could arrange), isn't listed. - Docs: a handle can end a CIBA request for anyone, though only its user can approve it; and account closure misses grants still in flight (an unexchanged code, an unpolled CIBA approval), so refuse the subject at sign-in and revoke again once their lifetimes pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
osanderson
force-pushed
the
fix/registry-inbox-robustness
branch
from
November 15, 2026 16:52
9e1364a to
74e068b
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes the CIBA Lows 1, 2 and 5 and the grant-registry Lows 2, 3 and 4 from the v0.74.0 security review, plus three Info items. It doesn't depend on #866 or #867.
Changes
LookupBackchannelInteractionanswered it asinvalid_request, so the inbox showed empty andDenyBackchannelInteractionsreturned(0, nil)server_error; a client no longer registered isunauthorized_client(asLookupInteractionanswers)RevokeSubjectGrants/DenyBackchannelInteractionsact on every readable entry, carry on past failures, and report every failure joined, with the count.RevokeListedGrantrevokes a readable grant whatever the others' stateDenyBackchannelInteractionsclears it when it finds the request already decidedRevokeListedGrantcan't be steered at another token. An inbox entry whose request is bound to another subject than the one it's filed under isn't listedDependencies.BackchannelInboxnow says a handle can still end a request for anyone; only approval is bound to the user.RevokeSubjectGrantsand GETTING_STARTED now say that account closure misses grants still in flight (an unexchanged code, an unpolled CIBA approval): refuse the subject at sign-in, and revoke again once those lifetimes passListGrantsandListBackchannelInteractionsstill fail on an unreadable entry rather than hide it. Only the bulk revoke and deny calls carry on past one.Tests
RevokeSubjectGrantsrevokes the readable grant past an unreadable entry, and attempts every grant when deletes fail.RevokeListedGrantworks past an unreadable entry.LookupBackchannelInteraction's error codes cover an unregistered client, an unavailable client store, an unreadable request and an unavailable backchannel store.server.GrantEntryKey, from a test-onlyexport_test.go).🤖 Generated with Claude Code