Repository navigation
fix(server): don't double-encode the implicit and hybrid fragment - #5183
Merged
Merged
Conversation
Signed-off-by: shlee1223 <shlee1223@raoncorp.com>
kuangruan
pushed a commit
to kuangruan/dex
that referenced
this pull request
Nov 25, 2026
10 commits since 60f28dd: ID-JAG audience binding and auth_time, the allowedGroups enforcement fix, ent blocked_until NULL handling, api username validation, LDAP startTLS port default, implicit/hybrid fragment encoding, and connector fixes. No changes are proposed upstream. * 'master' of https://github.com/dexidp/dex: feat(oauth2): let an ID-JAG policy set the client's ID at each audience (dexidp#5181) feat(oauth2): carry auth_time from the subject token into the ID-JAG (dexidp#5180) fix(connector/github): return UserNotInRequiredGroupsError when user lacks org or team access (dexidp#5100) fix(storage/ent): store an unset blocked_until as NULL (dexidp#5163) fix(api): require a username in CreatePassword (dexidp#5162) fix(ldap): default to port 389 when startTLS is set (dexidp#5184) fix(server): don't double-encode the implicit and hybrid fragment (dexidp#5183) fix(oidc)!: enforce allowedGroups when insecureEnableGroups is unset (dexidp#5185) feat(server): allow starting without connectors when the connectors API is enabled (dexidp#5061) fix(server): type access tokens at+jwt for clients with an ID-JAG policy (dexidp#5179)
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.
Overview
Hi! The implicit and hybrid flows put the encoded response values into
u.Fragment, which holds the decoded form, sou.String()percent-encodes them again. Astateofa/bis sent asstate=a%252Fbinstead ofstate=a%2Fb(RFC 6749 Section 4.2.2, Appendix B), and a browser client readinglocation.hashgets a differentstatethan it sent.What this PR does / why we need it
Sets
u.RawFragmentto the encoded values, as the code flow does withu.RawQuery.TestOAuth2ImplicitFlownow uses astatewith reserved characters and checks it in the raw fragment. The test previously parsed the already-decodedu.Fragment, which hid the extra encoding.