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></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.
Credit: support@hackerone.com support@hackerone.com
Affected Software | Affected Version | How to fix |
---|---|---|
Punkave Sanitize-html | <=1.11.1 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2017-16016 is classified as a high severity vulnerability due to its potential for cross-site scripting attacks.
To fix CVE-2017-16016, update the 'sanitize-html' package to version 1.11.2 or later.
CVE-2017-16016 affects versions of 'sanitize-html' up to and including 1.11.1.
CVE-2017-16016 can lead to cross-site scripting (XSS) attacks if user input is not properly sanitized.
A workaround for CVE-2017-16016 is to avoid using non-text tags in the allowedTags configuration within the 'sanitize-html' library.