{"id":"CVE-2022-23518","aliases":["CVE-2022-23518","GHSA-mcvf-2q2m-x72m"],"related":[],"kind":"vulnerability","state":"published","title":"Improper neutralization of data URIs allows XSS in rails-html-sanitizer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nrails-html-sanitizer `>= 1.0.3, < 1.4.4` is vulnerable to cross-site scripting via data URIs when used in combination with Loofah `>= 2.1.0`.\n\n\n## Mitigation\n\nUpgrade to rails-html-sanitizer `>= 1.4.4`.\n\n\n## Severity\n\nThe maintainers have evaluated this as [Medium Severity 6.1](https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).\n\n\n## References\n\n- [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html)\n- [SVG MIME Type (image/svg+xml) is misleading to developers · Issue #266 · w3c/svgwg](https://github.com/w3c/svgwg/issues/266)\n- https://github.com/rails/rails-html-sanitizer/issues/135\n- https://hackerone.com/reports/1694173\n\n\n## Credit\n\nThis vulnerability was independently reported by Maciej Piechota (@haqpl) and Mrinmoy Das (@goromlagche).","format":"markdown","source":"ghsa"},{"lang":"es","text":"rails-html-sanitizer es responsable de sanitizar fragmentos HTML en aplicaciones Rails. Las versiones &gt;= 1.0.3, &lt; 1.4.4 son vulnerables a Cross-Site Scripting (XSS) a través de URI de datos cuando se usan en combinación con Loofah &gt;= 2.1.0. Este problema está parcheado en la versión 1.4.4.","source":"nvd"}],"published":"2022-12-13T17:45:39.000Z","modified":"2026-06-17T04:30:17.073Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 1.0.3, < 1.4.4","status":"affected"}],"vendor":"rails","product":"rails-html-sanitizer","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.0.3","status":"affected","fixed":"1.4.4"}],"ecosystem":"RubyGems","package":"rails-html-sanitizer","purl":"pkg:gem/rails-html-sanitizer","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.0.3","fixed":"1.4.4"}],"vendor":"rubyonrails","product":"rails_html_sanitizers","cpe":"cpe:2.3:a:rubyonrails:rails_html_sanitizers:*:*:*:*:*:rails:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","introduced":"2.1.0","fixed":"2.19.1"}],"vendor":"loofah_project","product":"loofah","cpe":"cpe:2.3:a:loofah_project:loofah:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rails/rails-html-sanitizer/issues/135","tags":["exploit","issue-tracking","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://hackerone.com/reports/1694173","tags":["permissions-required","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/09/msg00012.html","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/09/msg00045.html","tags":["web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23518","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/w3c/svgwg/issues/266","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rails/rails-html-sanitizer","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-23518.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-23518","url":"https://www.cve.org/CVERecord?id=CVE-2022-23518","licence":"CVE Terms of Use","modified":"2025-11-03T21:45:59.030Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mcvf-2q2m-x72m","url":"https://github.com/advisories/GHSA-mcvf-2q2m-x72m","licence":"CC-BY-4.0","modified":"2025-11-04T17:04:00.396Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-23518","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23518","licence":"Public domain","modified":"2026-06-17T04:30:17.073Z"}],"updatedAt":"2026-11-25T22:58:17.528Z","epss":{"score":0.00944,"percentile":0.62071,"date":"2026-12-01T12:00:22.000Z"}}