| Package | Affected versions | Patched versions |
|---|---|---|
| sanitize-html | ≤ 1.11.1 | |
| sanitize-html | < 1.11.4 | 1.11.4 |
Affected versions of sanitize-html are vulnerable to cross-site scripting when allowedTags includes at least one nonTextTag.
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>!
Update to version 1.11.4 or later.
Running one of these products? Scan your site to see whether it exposes a vulnerable version.
Scan my site free