{"schema_version":"1.7.3","id":"GHSA-mcvf-2q2m-x72m","published":"2022-12-13T17:45:39Z","modified":"2025-11-04T17:04:00.396884Z","aliases":["CVE-2022-23518"],"summary":"Improper neutralization of data URIs may allow XSS in rails-html-sanitizer","details":"## 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).","affected":[{"package":{"name":"rails-html-sanitizer","ecosystem":"RubyGems","purl":"pkg:gem/rails-html-sanitizer"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.0.3"},{"fixed":"1.4.4"}]}],"versions":["1.0.3","1.0.4","1.1.0","1.2.0","1.3.0","1.4.0","1.4.1","1.4.2","1.4.3"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/12/GHSA-mcvf-2q2m-x72m/GHSA-mcvf-2q2m-x72m.json"}}],"references":[{"type":"WEB","url":"https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23518"},{"type":"WEB","url":"https://github.com/rails/rails-html-sanitizer/issues/135"},{"type":"WEB","url":"https://github.com/w3c/svgwg/issues/266"},{"type":"WEB","url":"https://hackerone.com/reports/1694173"},{"type":"PACKAGE","url":"https://github.com/rails/rails-html-sanitizer"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-23518.yml"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2023/09/msg00012.html"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2024/09/msg00045.html"}],"database_specific":{"cwe_ids":["CWE-79"],"github_reviewed":true,"github_reviewed_at":"2022-12-13T17:45:39Z","nvd_published_at":"2022-12-14T17:15:00Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"}]}