-
Notifications
You must be signed in to change notification settings - Fork 277
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
allowHtml prone to XSS-Vulnerabilities #235
Comments
Really? I remember looking at this stuff too much and that is why I never let real angular to be executed within toasts. Shoulndn't |
No, it asserts that the passed string comes from a trusted source and doesn't need any sanitizing ... Or as the docs put it:
You can also check the implementation. Note that the parameter to |
I see. I always assumed that the toasts were generated by a trusted source and never by the user and I think that is the right idea. |
Please document such assumptions.
Well, we used it to display an error message received from the server ... which happened to quote invalid user input ... |
Can't you just remove the $sce.trustAsHtml calls? This should cause angular to automatically sanitize the HTML, removing dangerous tags, but leaving harmless tags as they are ... |
By trusting all HTML, toastr bypasses the XSS protection provided by angular:
I think it is not toastr's place to assert that arbitrary HTML is safe for direct inclusion in the DOM.
(this actually gave rise to an XSS vulnerability in one of our applications)
The text was updated successfully, but these errors were encountered: