Skip to content

Commit

Permalink
Merge pull request from GHSA-v98m-398x-269r
Browse files Browse the repository at this point in the history
  • Loading branch information
kjac authored Dec 11, 2023
1 parent cdd4d2a commit 4a7ad4a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ angular.module('umbraco').controller("Umbraco.LoginController", function (events
//check if there's a returnPath query string, if so redirect to it
var locationObj = $location.search();
if (locationObj.returnPath) {
path = decodeURIComponent(locationObj.returnPath);
// ensure that the returnPath is a valid URL under the current origin (prevents DOM-XSS among other things)
const returnPath = decodeURIComponent(locationObj.returnPath);
const url = new URL(returnPath, window.location.origin);
if (url.origin === window.location.origin) {
path = returnPath;
}
}

// Ensure path is not absolute
Expand Down

0 comments on commit 4a7ad4a

Please sign in to comment.