Описание
Cross-Site Scripting in sanitize-html
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.
Ссылки
- 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/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
Пакеты
Наименование
sanitize-html
npm
Затронутые версииВерсия исправления
<= 1.11.1
1.11.4
Связанные уязвимости
CVSS3: 6.1
nvd
больше 7 лет назад
Sanitize-html is a library for scrubbing html input of malicious values. Versions 1.11.1 and below are vulnerable to cross site scripting (XSS) in certain scenarios: If allowed at least one nonTextTags, the result is a potential XSS vulnerability.
CVSS3: 6.1
debian
больше 7 лет назад
Sanitize-html is a library for scrubbing html input of malicious value ...