{"id":"CVE-2018-3740","published":"2018-03-30T19:00:00Z","modified":"2024-08-05T04:50:30Z","title":"A specially crafted HTML fragment can cause Sanitize gem for Ruby to allow non-whitelisted attributes to be used on a…","vendor":"Ryan Grove","product":"sanitize (ruby gem)","tier":"tail","description":{"text":"A specially crafted HTML fragment can cause Sanitize gem for Ruby to allow non-whitelisted attributes to be used on a whitelisted HTML element.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.01468,"percentile":0.74369,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://www.debian.org/security/2018/dsa-4358","tags":["vendor-advisory","x_refsource_DEBIAN"]},{"url":"https://github.com/rgrove/sanitize/issues/176","tags":["x_refsource_CONFIRM"]},{"url":"https://about.gitlab.com/2018/06/25/security-release-gitlab-11-dot-0-dot-1-released/","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/rgrove/sanitize/commit/01629a162e448a83d901456d0ba8b65f3b03d46e","tags":["x_refsource_CONFIRM"]}],"priority":{"score":14.9,"factors":[{"name":"EPSS percentile","points":14.87}]},"vendorSlug":"ryan-grove","affectedVersions":[{"vendor":"Ryan Grove","product":"sanitize (ruby gem)","versions":["< 4.6.3"]}],"affected":[{"ecosystem":"RubyGems","package":"sanitize","vulnerableRanges":[">=3.0.0, <4.6.3"],"patched":["4.6.3"],"from":["GHSA-7f42-p84j-f58p"],"provenance":"source"}],"summary":{"text":"The sanitize Ruby gem, maintained by Ryan Grove, contains a flaw in its HTML parsing and filtering logic that can be triggered by a specially crafted HTML fragment. An attacker who can supply HTML that the application passes through sanitize can cause non-whitelisted attributes to be retained on whitelisted elements, enabling cross-site scripting.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:46:00Z"},"euvd":{"id":"EUVD-2018-0174","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-rgrove-sanitize-cve-2018-3740","children":[{"from":"CVE-2018-3740","to":"CVE-2023-23627","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["lib/sanitize/transformers/clean_element.rb"],"commits":["https://github.com/rgrove/sanitize/commit/01629a162e448a83d901456d0ba8b65f3b03d46e","https://github.com/rgrove/sanitize/commit/93feeb38e21864146bb29191792b971dbe1ec62e","https://github.com/rgrove/sanitize/commit/ec14265e530dc3fe31ce2ef773594d3a97778d22"],"basis":"shared function","functions":["call"]}]}]}}