{"id":"CVE-2022-23518","published":"2022-12-14T16:22:34Z","modified":"2025-11-03T21:45:59Z","title":"Improper neutralization of data URIs allows XSS in rails-html-sanitizer","vendor":"rails","product":"rails-html-sanitizer","tier":"tail","description":{"text":"rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Versions >= 1.0.3, < 1.4.4 are vulnerable to cross-site scripting via data URIs when used in combination with Loofah >= 2.1.0. This issue is patched in version 1.4.4.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.1,"severity":"MEDIUM","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00944,"percentile":0.61918,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/rails/rails-html-sanitizer/issues/135","tags":["x_refsource_MISC"]},{"url":"https://hackerone.com/reports/1694173","tags":["x_refsource_MISC"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/09/msg00012.html","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2024/09/msg00045.html","tags":[]}],"priority":{"score":16.7,"factors":[{"name":"EPSS percentile","points":12.38},{"name":"CVSS severity","points":4.27}]},"vendorSlug":"rails","affectedVersions":[{"vendor":"rails","product":"rails-html-sanitizer","versions":[">= 1.0.3, < 1.4.4"]}],"affected":[{"ecosystem":"RubyGems","package":"rails-html-sanitizer","vulnerableRanges":[">=1.0.3, <1.4.4"],"patched":["1.4.4"],"from":["GHSA-mcvf-2q2m-x72m"],"provenance":"source"}],"summary":{"text":"The flaw is improper neutralization of data URIs in the HTML sanitization component of rails-html-sanitizer, the library Rails applications use to sanitize HTML fragments. Versions from 1.0.3 up to but not including 1.4.4 are affected when used together with Loofah 2.1.0 or later. An attacker can inject a data URI that leads to cross-site scripting in the page where the sanitized content is rendered, provided the victim is induced to interact with the content (for example, by clicking a link) and no authentication is required by the attacker.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:24:09Z"},"euvd":{"id":"EUVD-2022-7685","exploited":false,"provenance":"source"}}