Skip to content

Cross-Site Scripting in sanitize-html

Moderate severity GitHub Reviewed Published Nov 9, 2018 to the GitHub Advisory Database • Updated Sep 8, 2023

Package

npm sanitize-html (npm)

Affected versions

< 1.2.3

Patched versions

1.2.3

Description

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.

References

Published to the GitHub Advisory Database Nov 9, 2018
Reviewed Jun 16, 2020
Last updated Sep 8, 2023

Severity

Moderate
6.1
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Weaknesses

CVE ID

CVE-2017-16017

GHSA ID

GHSA-wg96-3933-j2w5

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.