{"id":"CVE-2022-23515","aliases":["CVE-2022-23515","GHSA-228g-948r-83gx"],"related":[],"kind":"vulnerability","state":"published","title":"Improper neutralization of data URIs may allow XSS in Loofah","summary":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Loofah >= 2.1.0, < 2.19.1 is vulnerable to cross-site scripting via the image/svg+xml media type in data URIs. This issue is patched in version 2.19.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Loofah >= 2.1.0, < 2.19.1 is vulnerable to cross-site scripting via the image/svg+xml media type in data URIs. This issue is patched in version 2.19.1.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nLoofah `>= 2.1.0, < 2.19.1` is vulnerable to cross-site scripting via the `image/svg+xml` media type in data URIs.\n\n\n## Mitigation\n\nUpgrade to Loofah `>= 2.19.1`.\n\n\n## Severity\n\nThe Loofah 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://hackerone.com/reports/1694173\n- https://github.com/flavorjones/loofah/issues/101\n\n## Credit\n\nThis vulnerability was responsibly reported by Maciej Piechota (@haqpl).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Loofah es una librería general para manipular y transformar documentos y fragmentos HTML / XML, construida sobre Nokogiri. Loofah &gt;= 2.1.0, &lt; 2.19.1 es vulnerable a Cross-Site Scripting (XSS) a través del tipo de medio image/svg+xml en las URI de datos. Este problema está parcheado en la versión 2.19.1.","source":"nvd"}],"published":"2022-12-13T17:39:36.000Z","modified":"2026-06-17T04:30:16.723Z","severity":{"scorer":"GitHub_M","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"},"severities":[{"scorer":"GitHub_M","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":"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":">= 2.1.0, < 2.19.1","status":"affected"}],"vendor":"flavorjones","product":"loofah","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.19.1"}],"ecosystem":"RubyGems","package":"loofah","purl":"pkg:gem/loofah","source":"ghsa"},{"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"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/flavorjones/loofah/security/advisories/GHSA-228g-948r-83gx","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/flavorjones/loofah/issues/101","tags":["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/msg00011.html","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/09/msg00044.html","tags":["web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23515","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/w3c/svgwg/issues/266","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/flavorjones/loofah/commit/415677f3cf7f9254f42f811e784985cd63c7407f","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/flavorjones/loofah","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/CVE-2022-23515.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-23515","url":"https://www.cve.org/CVERecord?id=CVE-2022-23515","licence":"CVE Terms of Use","modified":"2025-11-03T21:45:54.553Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-228g-948r-83gx","url":"https://github.com/advisories/GHSA-228g-948r-83gx","licence":"CC-BY-4.0","modified":"2025-11-04T17:03:00.052Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-23515","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23515","licence":"Public domain","modified":"2026-06-17T04:30:16.723Z"}],"updatedAt":"2026-11-25T22:58:17.524Z","epss":{"score":0.00877,"percentile":0.60083,"date":"2026-12-01T12:00:22.000Z"}}