CVE-2017-16016
Cross-Site Scripting in sanitize-html
CVE-2017-16016 is a medium vulnerability (CVSS 6.1) in Punkave Sanitize-html, published June 4, 2018. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.34%, the 71st percentile. Fixed in sanitize-html 1.11.4.
Sanitize-html is a library for scrubbing html input of malicious values. Versions 1.11.1 and below are vulnerable to cross site scripting (XSS) in certain scenarios: If allowed at least one nonTextTags, the result is a potential XSS vulnerability.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
6.1
Sanitize-html is a library for scrubbing html input of malicious values. Versions 1.11.1 and below are vulnerable to cross site scripting (XSS) in certain scenarios: If allowed at least one nonTextTags, the result is a potential XSS vulnerability.
- Record
CVE-2017-16016- CVSS 3.0
- 6.1 Medium
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - CVSS 2.0
- 4.3 Medium
AV:N/AC:M/Au:N/C:N/I:P/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
CVE List No score
Sanitize-html is a library for scrubbing html input of malicious values. Versions 1.11.1 and below are vulnerable to cross site scripting (XSS) in certain scenarios: If allowed at least one nonTextTags, the result is a potential XSS vulnerability.
- Record
CVE-2017-16016- Weakness
- CWE-79
- Updated
- 2026-11-02
EUVDEUVD-2018-0787 No score
Sanitize-html is a library for scrubbing html input of malicious values. Versions 1.11.1 and below are vulnerable to cross site scripting (XSS) in certain scenarios: If allowed at least one nonTextTags, the result is a potential XSS vulnerability.
- Record
EUVD-2018-0787- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-xc6g-ggrc-qq4r No score
Cross-Site Scripting in sanitize-html
Affected versions of sanitize-html are vulnerable to cross-site scripting when allowedTags includes at least one nonTextTag.
Proof of Concept
var sanitizeHtml = require('sanitize-html');
var dirty = '!<textarea></textarea><svg/onload=prompt`xs`></textarea>!';
var clean = sanitizeHtml(dirty, {
allowedTags: [ 'textarea' ]
});
console.log(clean);
// !<textarea></textarea><svg/onload=prompt`xs`></textarea>!
Recommendation
Update to version 1.11.4 or later.
- Record
GHSA-xc6g-ggrc-qq4r- Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
6.1
Sanitize-html is a library for scrubbing html input of malicious values. Versions 1.11.1 and below are vulnerable to cross site scripting (XSS) in certain scenarios: If allowed at least one nonTextTags, the result is a potential XSS vulnerability.
- Record
CVE-2017-16016- CVSS 3.0
- 6.1 Medium
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVGHSA-xc6g-ggrc-qq4r No score
Cross-Site Scripting in sanitize-html
Affected versions of sanitize-html are vulnerable to cross-site scripting when allowedTags includes at least one nonTextTag.
Proof of Concept
var sanitizeHtml = require('sanitize-html');
var dirty = '!<textarea></textarea><svg/onload=prompt`xs`></textarea>!';
var clean = sanitizeHtml(dirty, {
allowedTags: [ 'textarea' ]
});
console.log(clean);
// !<textarea></textarea><svg/onload=prompt`xs`></textarea>!
Recommendation
Update to version 1.11.4 or later.
- Record
GHSA-xc6g-ggrc-qq4r- Weakness
- CWE-79
- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2017-16016 No score
CVE-2017-16016 in @rootio/sanitize-html - Patched by Root
Root has patched CVE-2017-16016 in the @rootio/sanitize-html package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2017-16016- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
sanitize-htmlnpm |
through 1.11.1 | 1.11.4 |
sanitize-htmlnpm |
before 1.11.4 | 1.11.4 |
@rootio/sanitize-htmlRoot:npm |
before 1.4.2-root.io.5 | 1.4.2-root.io.51.4.2-root.io.61.4.2-root.io.71.4.2-root.io.81.4.2-root.io.9 |
sanitize-htmlRoot:npm |
before 1.4.2-aikido.9 | 1.4.2-aikido.9 |
History
| When | Changed | Sources |
|---|---|---|
| 2026-11-03 | aliases | EUVD |
| 2026-11-02 | created | CVE List, GitHub Advisories, NVD, OSV |
References
nodesecurity.io/advisories/154
github.com/punkave/sanitize-html/issues/100
github.com/punkave/sanitize-html/commit/5d205a1005ba0df80e21d8c64a15bb3accdb2403
nvd.nist.gov/vuln/detail/CVE-2017-16016
github.com/punkave/sanitize-html/commit/5d205a1005ba0df80e21d8c64a15bb3accdb2403)))
github.com/advisories/GHSA-xc6g-ggrc-qq4r
npmjs.com/package/sanitize-html
npmjs.com/advisories/154