7.5high
Inefficient Regular Expression Complexity in rails-html-sanitizer
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.59% (higher than 76% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-5x79-w82f-gw8w
Description
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Certain configurations of rails-html-sanitizer < 1.4.4 use an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption. This issue has been patched in version 1.4.4.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rails rails-html-sanitizer | < 1.4.4 | CVE List |
| rails-html-sanitizer (RubyGems) | before 1.4.4 | GitHub Advisory Database |
| rubyonrails rails_html_sanitizers | before 1.4.4 | NVD |
| debian debian_linux | 10.0 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Certain configurations of rails-html-sanitizer < 1.4.4 use an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption. This issue has been patched in version 1.4.4.
GitHub Advisory Database
Summary
Certain configurations of rails-html-sanitizer < 1.4.4 use an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption.
Mitigation
Upgrade to rails-html-sanitizer >= 1.4.4.
Severity
The maintainers have evaluated this as High Severity 7.5 (CVSS3.1).
References
- CWE - CWE-1333: Inefficient Regular Expression Complexity (4.9)
- https://hackerone.com/reports/1684163
Credit
This vulnerability was responsibly reported by @ooooooo-q (https://github.com/ooooooo-q).
NVD (es)
rails-html-sanitizer es responsable de sanitizar fragmentos HTML en aplicaciones Rails. Ciertas configuraciones de rails-html-sanitizer < 1.4.4 utilizan una expresión regular ineficiente que es susceptible a un retroceso excesivo al intentar sanitizar ciertos atributos SVG. Esto puede provocar una denegación de servicio a través del consumo de recursos de CPU. Este problema se ha corregido en la versión 1.4.4.
References
| https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-5x79-w82f-gw8w | third-party-advisory, web | |
| https://github.com/rails/rails-html-sanitizer/commit/56c61c0cebd1e493e8ad7bca2a0191609a4a6979 | patch, third-party-advisory, web | |
| https://hackerone.com/reports/1684163 | permissions-required, third-party-advisory, web | |
| https://lists.debian.org/debian-lts-announce/2023/09/msg00012.html | mailing-list, third-party-advisory, web | |
| https://lists.debian.org/debian-lts-announce/2024/09/msg00045.html | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-23517 | advisory | |
| https://github.com/rails/rails-html-sanitizer | package | |
| https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-23517.yml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-23517 changed 2025-11-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-5x79-w82f-gw8w changed 2025-11-04 | CC-BY-4.0 |
| NVD | CVE-2022-23517 changed 2026-06-17 | Public domain |