UID2-7641: Remove support for V2 refresh tokens - #2718
Open
samin-ttd wants to merge 4 commits into
Open
Conversation
samin-ttd
force-pushed
the
sra-UID2-7641-fix-refresh-padding-oracle-vulnerability
branch
from
September 2, 2026 05:50
0690322 to
b220bdf
Compare
…[no-jira - reason: automated release] Automated release (PR #2719).
samin-ttd
force-pushed
the
sra-UID2-7641-fix-refresh-padding-oracle-vulnerability
branch
from
September 2, 2026 23:01
c82fcee to
7cfb5b1
Compare
…[no-jira - reason: automated release] Automated release (PR #2721).
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.
Summary
Fixes a padding-oracle-style information leak in the
/token/refreshendpoint. Previously, onlyClientInputValidationExceptionduring refresh token decoding was caught and mapped toRefreshResponse.Invalid— any other exception (notablyBadPaddingException/IllegalBlockSizeExceptionfrom the underlying cipher on malformed ciphertext) propagated up and resulted in a different response (500) than the standard invalid-token response (400). This discrepancy let an attacker distinguish "malformed padding" from "well-formed but invalid token" purely from the HTTP status code — a classic padding oracle.Change
Exceptionhandler around refresh token decoding.BadPaddingException/IllegalBlockSizeException(and any other exception) are now logged and mapped toRefreshResponse.Invalid, so the response is indistinguishable from other invalid-token cases — always 400, no signal leaked to the caller.WARN) from truly unexpected errors (ERROR) in logging, to preserve operational visibility without changing the response behavior.Testing