diff --git a/open-redirect.js b/open-redirect.js new file mode 100644 index 0000000..27f66f2 --- /dev/null +++ b/open-redirect.js @@ -0,0 +1,18 @@ +var app = angular.module('MyApp', []); +app.controller('myCtrl', function($scope, $sce) { + $scope.userInput = 'foo'; + + $scope.sayHello = function() { + // ruleid:detect-angular-open-redirect + $window.location.href = input + '/app/logout'; + input = $scope.input; + // ruleid:detect-angular-open-redirect + $window.location.href = input + '/app/logout'; + + //Data is not coming from user input + $location.location.location = test + // ok:detect-angular-open-redirect + $window.location.href = "//untatintedredirect" + }; + +});