I am trying to exploit the XSS Vurnablity in AngularJS by a simple example:
SNIPPET
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular.min.js"></script>
<script>
//app declaration
var app = angular.module('myApp', []);
//controller declaration
app.controller('myCtrl', function ($scope) {
$scope.name = 9;
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<input type="text" ng-model="name">
<!-- sanitized html -->
<p ng-bind="name"></p>
<hr/>
<img src="apple.png" />
</body>
</html>
Result:
Expectation:
I expected 2 apples to be there. First by ng-bind and second by normal image (as per html). I can see second apple image (as in same folder as my html file), but why not first? Though, I can see the link in executed code?