CWE
79
Advisory Published
Advisory Published
Updated

CVE-2017-16016: XSS

First published: Mon Jun 04 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=prompt`xs`&gt;</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.

Credit: support@hackerone.com support@hackerone.com

Affected SoftwareAffected VersionHow to fix
Punkave Sanitize-html<=1.11.1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • 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.

  • How do I fix CVE-2017-16016?

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

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

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

  • 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.

  • 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.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203