CVE-2017-16016
EPSS 0.29%Cross-Site Scripting in sanitize-html
發布日:2018/11/9修改日:2023/11/8
描述
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.
受影響套件(1)
- npm/sanitize-htmlfrom 0, < 1.11.4
參考連結(7)
- ADVISORYhttps://github.com/advisories/GHSA-xc6g-ggrc-qq4r
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2017-16016
- WEBhttps://github.com/punkave/sanitize-html/commit/5d205a1005ba0df80e21d8c64a15bb3accdb2403
- WEBhttps://github.com/punkave/sanitize-html/commit/5d205a1005ba0df80e21d8c64a15bb3accdb2403)))
- WEBhttps://github.com/punkave/sanitize-html/issues/100
- WEBhttps://npmjs.com/package/sanitize-html#discarding-the-entire-contents-of-a-disallowed-tag
- WEBhttps://www.npmjs.com/advisories/154