CVE-2022-23514: Inefficient Regular Expression Complexity in Loofah
Summary
Loofah < 2.19.1 contains 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 Loofah >= 2.19.1.
Severity
The Loofah 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).
Other sources
An inefficient regular expression vulnerability was found in rubygem loofah. While sanitizing certain SVG attributes, loofah is susceptible to excessive backtracking, which can result in a denial of service through CPU resource consumption.
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Loofah < 2.19.1 contains 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 is patched in version 2.19.1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rubygems/loofahto a version that resolves this vulnerability.Fixed in 2.19.1 - Upgrade
Upgrade
redhat/rubygem-loofahto a version that resolves this vulnerability.Fixed in 0:2.19.1-1.el8 - Upgrade
Upgrade
redhat/rubygem-loofahto a version that resolves this vulnerability.Fixed in 2.19.1 - Upgrade
Upgrade
debian/ruby-loofahto a version that resolves this vulnerability.Fixed in 2.19.1-1 - Upgrade
Upgrade
debian/ruby-loofahto a version that resolves this vulnerability.Fixed in 2.19.1-1Fixed in 2.24.0-1Fixed in 2.25.2-1Fixed in 2.25.3-1 - Upgrade
Upgrade
Loofahto a version that resolves this vulnerability.Fixed in 2.19.1
Event History
Frequently Asked Questions
What is the severity of CVE-2022-23514?
CVE-2022-23514 is considered a denial of service vulnerability due to excessive CPU resource consumption.
How do I fix CVE-2022-23514?
To fix CVE-2022-23514, upgrade Loofah to version 2.19.1 or later.
What versions of Loofah are affected by CVE-2022-23514?
Loofah versions earlier than 2.19.1 are affected by CVE-2022-23514.
What is the impact of CVE-2022-23514?
The impact of CVE-2022-23514 can lead to a denial of service through excessive CPU usage.
Is CVE-2022-23514 specific to certain platforms?
CVE-2022-23514 specifically affects the Loofah Ruby gem regardless of the platform used.