{"id":"CVE-2018-3741","published":"2018-03-30T19:00:00Z","modified":"2024-08-05T04:50:30Z","title":"There is a possible XSS vulnerability in all rails-html-sanitizer gem versions below 1.0.4 for Ruby","vendor":"Rails","product":"rails-html-sanitizer","tier":"tail","description":{"text":"There is a possible XSS vulnerability in all rails-html-sanitizer gem versions below 1.0.4 for Ruby. The gem allows non-whitelisted attributes to be present in sanitized output when input with specially-crafted HTML fragments, and these attributes can lead to an XSS attack on target applications. This issue is similar to CVE-2018-8048 in Loofah. All users running an affected release should either upgrade or use one of the workarounds immediately.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.01253,"percentile":0.70172,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/rails/rails-html-sanitizer/commit/f3ba1a839a35f2ba7f941c15e239a1cb379d56ae","tags":["x_refsource_CONFIRM"]}],"priority":{"score":14.0,"factors":[{"name":"EPSS percentile","points":14.03}]},"vendorSlug":"rails","affectedVersions":[{"vendor":"Rails","product":"rails-html-sanitizer","versions":["<= 1.0.3"]}],"affected":[{"ecosystem":"RubyGems","package":"rails-html-sanitizer","vulnerableRanges":["<1.0.4"],"patched":["1.0.4"],"from":["GHSA-px3r-jm9g-c8w8"],"provenance":"source"}],"summary":{"text":"The flaw is an cross-site scripting (XSS) weakness in the rails-html-sanitizer gem, a Ruby component from Rails, affecting versions below 1.0.4. The gem lets non-whitelisted attributes pass through into sanitized output when it is given specially crafted HTML fragments. An attacker who can supply such HTML to an application that uses the affected sanitizer can cause script-capable content to reach target applications, enabling XSS.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:51:53Z"},"euvd":{"id":"EUVD-2018-0191","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-rails-html-sanitizer-cve-2015-7579","parents":[{"from":"CVE-2015-7579","to":"CVE-2018-3741","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["lib/rails/html/scrubbers.rb"],"commits":["https://github.com/rails/rails-html-sanitizer/commit/49dfc1584c5b8e35a4ffabf8356ba3df025e8d3f","https://github.com/rails/rails-html-sanitizer/commit/f3ba1a839a35f2ba7f941c15e239a1cb379d56ae"],"basis":"shared function","functions":["scrub_attribute"]}]},{"from":"CVE-2018-8048","to":"CVE-2018-3741","relation":"related","confidence":"low","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"related","quote":"This issue is similar to CVE-2018-8048 in Loofah.","from":"CVE.org","in":"CVE-2018-3741"}]}],"children":[{"from":"CVE-2018-3741","to":"CVE-2022-23517","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["lib/rails/html/scrubbers.rb"],"commits":["https://github.com/rails/rails-html-sanitizer/commit/f3ba1a839a35f2ba7f941c15e239a1cb379d56ae","https://github.com/rails/rails-html-sanitizer/commit/56c61c0cebd1e493e8ad7bca2a0191609a4a6979"],"basis":"shared function","functions":["scrub_attribute"]}]},{"from":"CVE-2018-3741","to":"CVE-2026-73648","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["rails-html-sanitizer.gemspec"],"commits":["https://github.com/rails/rails-html-sanitizer/commit/f3ba1a839a35f2ba7f941c15e239a1cb379d56ae","https://github.com/rails/rails-html-sanitizer/commit/74dcb8053e6da9921246ce71b06ad9fd65b19586"],"basis":"shared function","functions":["scrub_attribute"]}]}]}}