{"schemaVersion":4,"id":"CVE-2020-4054","aliases":["UBUNTU-CVE-2020-4054","USN-4543-1","DEBIAN-CVE-2020-4054","DSA-4730-1","GHSA-p4x4-rw2p-8j8m"],"status":"published","duplicateOf":null,"title":"Cross-site Scripting in Sanitize","description":"In Sanitize (RubyGem sanitize) greater than or equal to 3.0.0 and less than 5.2.1, there is a cross-site scripting vulnerability. When HTML is sanitized using Sanitize's \"relaxed\" config, or a custom config that allows certain elements, some content in a math or svg element may not be sanitized correctly even if math and svg are not in the allowlist. You are likely to be vulnerable to this issue if you use Sanitize's relaxed config or a custom config that allows one or more of the following HTML elements: iframe, math, noembed, noframes, noscript, plaintext, script, style, svg, xmp. Using carefully crafted input, an attacker may be able to sneak arbitrary HTML through Sanitize, potentially resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. This has been fixed in 5.2.1.","dates":{"published":"2020-06-16T22:10:13.000Z","modified":"2024-08-04T07:52:20.925Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.3,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":7.3,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":7.3,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","exploitability":10,"impact":5.7,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","score":7.3,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","exploitability":10,"impact":5.7,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Rubygems","score":7.3,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","exploitability":10,"impact":5.7,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7.3,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":6.8,"severity":"medium","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.01917,"percentile":0.80583,"severity":"low","asOf":"2026-12-04T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-11-04T00:00:00.000Z","baselineScore":0.01917},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01853,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-22T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-23T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-24T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-25T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-26T00:00:00.000Z","score":0.01855,"percentile":null},{"date":"2026-10-27T00:00:00.000Z","score":0.0187,"percentile":null},{"date":"2026-10-28T00:00:00.000Z","score":0.0187,"percentile":null},{"date":"2026-10-29T00:00:00.000Z","score":0.0187,"percentile":null},{"date":"2026-10-30T00:00:00.000Z","score":0.0187,"percentile":null},{"date":"2026-10-31T00:00:00.000Z","score":0.0187,"percentile":null},{"date":"2026-11-01T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-02T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-03T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-04T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.01917,"percentile":0.80583}],"last30":[{"date":"2026-11-04T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.01917,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.01917,"percentile":0.80583}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation","description":"The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.","type":"weakness","status":"Stable","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/79.html"}],"affected":[{"vendor":"debian","product":"ruby-sanitize","name":"ruby-sanitize","label":"ruby-sanitize","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/ruby-sanitize","purlType":"deb","versions":[{"text":"< 4.6.6-2.1","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"4.6.6-2.1","endInclusive":false}},{"text":"< 4.6.6-2.1~deb10u1","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"4.6.6-2.1~deb10u1","endInclusive":false}}],"versionsText":"< 4.6.6-2.1 | < 4.6.6-2.1~deb10u1","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"ruby-sanitize","name":"ruby-sanitize","label":"ruby-sanitize","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/ruby-sanitize","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null,"bounds":{"kind":"all"}},{"text":"< 4.6.6-2.1~0.20.04.1","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"4.6.6-2.1~0.20.04.1","endInclusive":false}}],"versionsText":"All versions (No fix recorded) | < 4.6.6-2.1~0.20.04.1","eol":null,"hubHref":null},{"vendor":"RubyGems","product":"sanitize","name":"sanitize","label":"sanitize","ecosystem":"RubyGems","cpePart":null,"purl":"pkg:gem/sanitize","purlType":"gem","versions":[{"text":"≥ 3.0.0, < 5.2.1","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":"3.0.0","startInclusive":true,"end":"5.2.1","endInclusive":false}}],"versionsText":"≥ 3.0.0, < 5.2.1","eol":null,"hubHref":null},{"vendor":"rgrove","product":"sanitize","name":"sanitize","label":"sanitize","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 3.0.0, < 5.2.1","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":"3.0.0","startInclusive":true,"end":"5.2.1","endInclusive":false}}],"versionsText":"≥ 3.0.0, < 5.2.1","eol":null,"hubHref":"/vendor/rgrove/sanitize"},{"vendor":"sanitize_project","product":"sanitize","name":"sanitize","label":"sanitize","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 3.0.0, < 5.2.1","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":"3.0.0","startInclusive":true,"end":"5.2.1","endInclusive":false}}],"versionsText":"≥ 3.0.0, < 5.2.1","eol":null,"hubHref":"/vendor/sanitize_project/sanitize"}],"affectedCount":5,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/rgrove/sanitize/security/advisories/GHSA-p4x4-rw2p-8j8m","label":"github.com/rgrove/sanitize/security/advisories/GHSA-p4x4-rw2p-8j8m","hostname":"github.com","tags":["X Refsource CONFIRM","REPORT","WEB","Third Party Advisory"]},{"url":"https://github.com/rgrove/sanitize/commit/a11498de9e283cd457b35ee252983662f7452aa9","label":"github.com/rgrove/sanitize/commit/a11498de9e283cd457b35ee252983662f7452aa9","hostname":"github.com","tags":["X Refsource MISC","REPORT","WEB","Patch","Third Party Advisory"]},{"url":"https://github.com/rgrove/sanitize/releases/tag/v5.2.1","label":"github.com/rgrove/sanitize/releases/tag/v5.2.1","hostname":"github.com","tags":["X Refsource MISC","REPORT","WEB","Release Notes","Third Party Advisory"]},{"url":"https://www.debian.org/security/2020/dsa-4730","label":"www.debian.org/security/2020/dsa-4730","hostname":"www.debian.org","tags":["Vendor Advisory","X Refsource DEBIAN","WEB"]},{"url":"https://usn.ubuntu.com/4543-1/","label":"usn.ubuntu.com/4543-1/","hostname":"usn.ubuntu.com","tags":["Vendor Advisory","X Refsource UBUNTU"]},{"url":"https://ubuntu.com/security/CVE-2020-4054","label":"ubuntu.com/security/CVE-2020-4054","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-4543-1","label":"ubuntu.com/security/notices/USN-4543-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2020-4054","label":"www.cve.org/CVERecord?id=CVE-2020-4054","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2020-4054","label":"security-tracker.debian.org/tracker/CVE-2020-4054","hostname":"security-tracker.debian.org","tags":["Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-4054","label":"nvd.nist.gov/vuln/detail/CVE-2020-4054","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/rgrove/sanitize","label":"github.com/rgrove/sanitize","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sanitize/CVE-2020-4054.yml","label":"github.com/rubysec/ruby-advisory-db/blob/master/gems/sanitize/CVE-2020-4054.yml","hostname":"github.com","tags":["WEB"]},{"url":"https://usn.ubuntu.com/4543-1","label":"usn.ubuntu.com/4543-1","hostname":"usn.ubuntu.com","tags":["WEB"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2020-06-16T22:10:13.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-04T07:52:20.925Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"priority":{"label":"prioritise","tag":"severe","reason":"Severe, CVSS 7.3 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 2% (FIRST, 04-12-2026)","nextStep":"Check applicability: affected before 5.2.1 (CNA); fix release not confirmed","rank":[0,0,0,0,2,73],"checkedSources":["cisa","enisa","circl","shadowserver","cisa-adp"],"evidence":[{"type":"epss","source":"FIRST","date":"2026-12-04T00:00:00.000Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"value":0.01917,"stale":false,"promoted":null},{"type":"cvss","source":"cve.org","date":"2024-08-04T07:52:20.925Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","version":"3.1","headline":true},{"type":"cvss","source":"osv_ubuntu","date":"2024-08-04T07:52:20.925Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","version":"3.1"},{"type":"cvss","source":"osv_debian","date":"2024-08-04T07:52:20.925Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","version":"3.1"},{"type":"cvss","source":"osv_rubygems","date":"2024-08-04T07:52:20.925Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","version":"3.1"},{"type":"cvss","source":"nvd","date":"2024-08-04T07:52:20.925Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","version":"3.1"},{"type":"cvss","source":"nvd","date":"2024-08-04T07:52:20.925Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","version":"2.0"}],"epss":{"value":0.01917,"date":"2026-12-04T00:00:00.000Z","stale":false,"promoted":null},"sources":[{"id":"cisa","lastSuccessfulSync":"2026-12-05T07:02:00.704Z","state":"fresh"},{"id":"enisa","lastSuccessfulSync":"2026-12-05T07:02:01.187Z","state":"fresh"},{"id":"circl","lastSuccessfulSync":"2026-12-05T07:02:01.389Z","state":"fresh"},{"id":"shadowserver","lastSuccessfulSync":null,"state":"unavailable"},{"id":"cisa-adp","lastSuccessfulSync":"2026-12-05T07:01:05.155Z","state":"fresh"},{"id":"epss","lastSuccessfulSync":"2026-12-05T07:01:59.185Z","state":"fresh"},{"id":"osv","lastSuccessfulSync":"2026-12-05T07:01:58.234Z","state":"fresh"}],"feedEvent":null},"meta":{"dataAsOf":"2026-12-05T07:24:13.677Z","stale":false,"partial":false}}