{"id":"CVE-2022-23520","aliases":["CVE-2022-23520","GHSA-rrfc-7g8p-99q8"],"related":[],"kind":"vulnerability","state":"published","title":"rails-html-sanitizer contains an incomplete fix for an XSS vulnerability","summary":"rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, there is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer due to an incomplete fix of CVE-2022-32209. Rails::Html::Sanitizer may allow an attacker to inject content if the application developer has overridden the sanitizer's allowed tags to allow both \"select\" and \"style\" elements. Code is only impacted if allowed tags are being overridden. This issue is patched in version 1.4.4. All users overriding the allowed tags to include both \"select\" and \"style\" should either upgrade or use this workaround: Remove either \"select\" or \"style\" from the overridden allowed tags. NOTE: Code is _not_ impacted if allowed tags are overridden using either the :tags option to the Action View helper method sanitize or the :tags option to the instance method SafeListSanitizer#sanitize.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, there is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer due to an incomplete fix of CVE-2022-32209. Rails::Html::Sanitizer may allow an attacker to inject content if the application developer has overridden the sanitizer's allowed tags to allow both \"select\" and \"style\" elements. Code is only impacted if allowed tags are being overridden. This issue is patched in version 1.4.4. All users overriding the allowed tags to include both \"select\" and \"style\" should either upgrade or use this workaround: Remove either \"select\" or \"style\" from the overridden allowed tags. NOTE: Code is _not_ impacted if allowed tags are overridden using either the :tags option to the Action View helper method sanitize or the :tags option to the instance method SafeListSanitizer#sanitize.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThere is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer. This is due to an incomplete fix of CVE-2022-32209.\n\n- Versions affected: ALL\n- Not affected: NONE\n- Fixed versions: 1.4.4\n\n\n## Impact\n\nA possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer may allow an attacker to inject content if the application developer has overridden the sanitizer's allowed tags to allow both \"select\" and \"style\" elements.\n\nCode is only impacted if allowed tags are being overridden using either of the following two mechanisms:\n\n1. Using the Rails configuration `config.action_view.sanitized_allow_tags=`:\n\n  ```ruby\n  # In config/application.rb\n  config.action_view.sanitized_allowed_tags = [\"select\", \"style\"]\n  ```\n\n  (see https://guides.rubyonrails.org/configuring.html#configuring-action-view)\n\n2. Using the class method `Rails::Html::SafeListSanitizer.allowed_tags=`:\n\n  ```ruby\n  # class-level option\n  Rails::Html::SafeListSanitizer.allowed_tags = [\"select\", \"style\"]\n  ```\n\nAll users overriding the allowed tags by either of the above mechanisms to include both \"select\" and \"style\" should either upgrade or use one of the workarounds immediately.\n\nNOTE: Code is _not_ impacted if allowed tags are overridden using either of the following mechanisms:\n\n- the `:tags` option to the Action View helper method `sanitize`.\n- the `:tags` option to the instance method `SafeListSanitizer#sanitize`.\n\n\n## Workarounds\n\nRemove either \"select\" or \"style\" from the overridden allowed tags.\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- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-32209\n- https://hackerone.com/reports/1654310\n\n\n## Credit\n\nThis vulnerability was responsibly reported by Dominic Breuker.","format":"markdown","source":"ghsa"},{"lang":"es","text":"rails-html-sanitizer es responsable de sanitizar fragmentos HTML en aplicaciones Rails. Antes de la versión 1.4.4, existe una posible vulnerabilidad XSS con ciertas configuraciones de Rails::Html::Sanitizer debido a una solución incompleta de CVE-2022-32209. Rails::Html::Sanitizer puede permitir que un atacante inyecte contenido si el desarrollador de la aplicación ha anulado las etiquetas permitidas del sanitizador para permitir elementos de \"select\" y \"style\". El código solo se ve afectado si se anulan las etiquetas permitidas. Este problema se solucionó en la versión 1.4.4. Todos los usuarios que anulen las etiquetas permitidas para incluir \"select\" y \"style\" deben actualizar o utilizar el workaround: eliminar \"select\" o \"style\" de las etiquetas permitidas anuladas. NOTA: El código _no_ se ve afectado si las etiquetas permitidas se anulan usando la opción :tags para el método auxiliar sanitizador de Action View o la opción :tags para el método de instancia SafeListSanitizer#sanitize.","source":"nvd"}],"published":"2022-12-13T17:51:40.000Z","modified":"2026-06-17T04:30:17.300Z","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":"< 1.4.4","status":"affected"}],"vendor":"rails","product":"rails-html-sanitizer","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.4.4"}],"ecosystem":"RubyGems","package":"rails-html-sanitizer","purl":"pkg:gem/rails-html-sanitizer","source":"ghsa"},{"ranges":[{"status":"affected","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"}],"references":[{"url":"https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-rrfc-7g8p-99q8","tags":["exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://hackerone.com/reports/1654310","tags":["exploit","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-23520","tags":["advisory"],"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-23520.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-23520","url":"https://www.cve.org/CVERecord?id=CVE-2022-23520","licence":"CVE Terms of Use","modified":"2025-11-03T21:46:02.126Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rrfc-7g8p-99q8","url":"https://github.com/advisories/GHSA-rrfc-7g8p-99q8","licence":"CC-BY-4.0","modified":"2025-11-04T17:00:59.503Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-23520","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23520","licence":"Public domain","modified":"2026-06-17T04:30:17.300Z"}],"updatedAt":"2026-11-25T22:58:17.534Z","epss":{"score":0.01209,"percentile":0.69254,"date":"2026-12-01T12:00:22.000Z"}}