Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems like growl HTML based messages are vulnerable for XSS attacks #116

Open
benbracha opened this issue Jun 24, 2016 · 0 comments
Open

Comments

@benbracha
Copy link

Some of our growl messages are created using a compiled HTML with user's input.
For example:

var html = 
'<span>' +
  Some ' + entityName + 's' + ' could not be ' + actionName + '. </br>' + 
  '</span>';

var messageElement = angular.element(html);
var scope = $rootScope.$new();
var linkedElement = $compile(messageElement)(scope);
growl.error(linkedElement.html());

In case we don't sanitize user's input ourselves, we may be exposed to XSS attacks (try to put use <script>alert('hello')</script> in the entityName, for example).

I wonder if this can be done internally by growl, as usually angularJS developers rely on angularJS "automatic" sanitization and don't pay attention to such issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant