MediumGHSA-wg96-3933-j2w5CVE-2017-16017
Cross-Site Scripting in sanitize-html
Published 9 Nov 2018 · Updated 8 Nov 2023
Affected package
- Affected
- <1.2.3
- Fixed in
- 1.2.3
Update to the fixed version for your release line, for example:
npm install sanitize-html@1.2.3Details
Affected versions of sanitize-html are vulnerable to cross-site scripting.
Proof of Concept:
<IMG SRC= onmouseover="alert('XSS');">
produces the following:
<img src="onmouseover="alert('XSS');"" />
This is definitely invalid HTML, but would suggest that it's being interpreted incorrectly by the parser.
Recommendation
Update to version 1.2.3 or later.
Is GHSA-wg96-3933-j2w5 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected sanitize-html, and gives you the command that fixes it.
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.