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

XSS Vulnerability "HIGH" due to default escapeHtml=false setting #689

Open
nmg196 opened this issue Jun 23, 2022 · 5 comments
Open

XSS Vulnerability "HIGH" due to default escapeHtml=false setting #689

nmg196 opened this issue Jun 23, 2022 · 5 comments

Comments

@nmg196
Copy link

nmg196 commented Jun 23, 2022

The default behaviour of toastr is that html displayed is not encoded.

So this code causes a browser popup:

var msg = 'Hello <script>alert("Danger!")</sc' + 'ript>';
toastr.success("Example <strong>Message</strong> " + msg);

There is a setting which controls this called "escapeHtml". However because this 'fix' is opt-in rather than the default behaviour, it gets flagged in pen tests and security scans as an unfixed HIGH vulnerability.
See: https://security.snyk.io/vuln/SNYK-JS-TOASTR-2396430

Is there no way that escapeHtml = true is the default, and you have to opt in to use HTML instead? Otherwise this library will be permanently flagged as having an XSS vulnerability - category "HIGH", which means it can't be used on many projects.

This would have to be through a new release as current release 2.1.4 is regarded as vulnerable (HIGH) in security scanners:

image

@peterlaws
Copy link

Is this project dead? This issue has been ignored?

@Jacob-Lockwood
Copy link

@peterlaws Yes it seems to be dead--the latest release was made in 2018

@peterlaws
Copy link

Anyone found a decent similar replacement?

@lucasrochadejesus
Copy link

Anyone found a decent similar replacement? [2]

daredloco added a commit to daredloco/live-controls that referenced this issue Dec 29, 2022
@NkazimuloMvundla
Copy link

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

5 participants