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
Describe the bug
AngularJS made a mistake where they double-dutied the $location.search() method.
In addition to passing a string, it allows a hash.
A hash, will utilize the # character (U+0023).
It then attempts to map the # to an object.
There is also a security concern with this.
If the search included a valid object, then an object may be passed.
This is an unknown state that has the uninvestigated potential for exploitation.
This affects all angularjs code and so we should probably check other projects for the same problem.
Any string that might include a '#' is a candidate for being fixed.
The solution is to re-encode the # back into a %23.
The rest of the process properly encodes the %23 into a # and should be left alone.
The problem happens explicitly with the $location.search() call.
To Reproduce
Steps to reproduce the behavior:
Go to any valid SAGE discover view.
Add # to the search and click search.
Reload the page.
See error.
Expected behavior
Reloading the page should be the same as the initial search.
There should be no HTTP 400 error code.
I think I understand the issue you discovered but do not understand the description of the cause. Could you reference Angular.js code in which the claim is describing?
Describe the bug
AngularJS made a mistake where they double-dutied the
$location.search()
method.In addition to passing a string, it allows a hash.
A hash, will utilize the
#
character (U+0023).It then attempts to map the # to an object.
There is also a security concern with this.
If the search included a valid object, then an object may be passed.
This is an unknown state that has the uninvestigated potential for exploitation.
This affects all angularjs code and so we should probably check other projects for the same problem.
Any string that might include a '#' is a candidate for being fixed.
The solution is to re-encode the
#
back into a%23
.The rest of the process properly encodes the
%23
into a#
and should be left alone.The problem happens explicitly with the
$location.search()
call.To Reproduce
Steps to reproduce the behavior:
#
to the search and click search.Expected behavior
Reloading the page should be the same as the initial search.
There should be no
HTTP 400
error code.Additional context
see: https://docs.angularjs.org/api/ng/service/$location#search
This issue report is derived from the spike investigation of #492.
The text was updated successfully, but these errors were encountered: