You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug: getHashFragmentParams incorrectly decodes entire hash fragment
Description
The UrlHelperService.getHashFragmentParams method is prematurely decoding the entire URL hash fragment with decodeURIComponent before parsing individual parameters. This causes issues when parameter values contain encoded special characters, particularly with Azure AD and implicit flow.
Steps to reproduce
Use implicit flow with Azure AD
Perform a silent refresh operation
When silent refresh fails, Azure AD returns a hash fragment containing parameters including error_uri which contains encoded URL characters
This decodes error_uri value to include a literal ? character, which then breaks the subsequent parsing because the question mark is interpreted as a parameter delimiter.
Expected behavior
The hash fragment should not be decoded as a whole. Instead, decoding should only be applied to individual parameters after they've been properly parsed into key-value pairs, which is already handled in the parseQueryString method:
Remove the line hash = decodeURIComponent(hash); from the getHashFragmentParams method, allowing parseQueryString to handle decoding each parameter individually.
The text was updated successfully, but these errors were encountered:
Bug:
getHashFragmentParams
incorrectly decodes entire hash fragmentDescription
The
UrlHelperService.getHashFragmentParams
method is prematurely decoding the entire URL hash fragment withdecodeURIComponent
before parsing individual parameters. This causes issues when parameter values contain encoded special characters, particularly with Azure AD and implicit flow.Steps to reproduce
error_uri
which contains encoded URL charactersCurrent behavior
The hash fragment from Azure AD like:
Is decoded prematurely with:
This decodes
error_uri
value to include a literal?
character, which then breaks the subsequent parsing because the question mark is interpreted as a parameter delimiter.Expected behavior
The hash fragment should not be decoded as a whole. Instead, decoding should only be applied to individual parameters after they've been properly parsed into key-value pairs, which is already handled in the
parseQueryString
method:Fix suggestion
Remove the line
hash = decodeURIComponent(hash);
from thegetHashFragmentParams
method, allowingparseQueryString
to handle decoding each parameter individually.The text was updated successfully, but these errors were encountered: