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

Add protection against XSS #86

Open
arialwhite opened this issue May 14, 2016 · 1 comment
Open

Add protection against XSS #86

arialwhite opened this issue May 14, 2016 · 1 comment

Comments

@arialwhite
Copy link

In my app the following code opens a dialog box with "hi" :
Notification.success("Some message <script>alert('hi')</script>")

It shows that my app was vulnerable to XSS because Notification was used in that sort of way : Notification.error("got an error : "+myError);

And myError is a string that can come from anywhere, and is unsecure.

My fix was to decore Notification service and apply $sanitize on strings.

@nadouani
Copy link

This one is in fact an issue since the documentation doesn't indicate that the service trust the message as HTML by default. We needed to take a look to the source code to discover it when we encountered an XSS issue.

IMHO this library shouldn't trust the message as HTML by default, but should provide an option to disable sanitization.

I can provide a PR if you want.

Thanks

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

2 participants