CVE-2022-23516
rubygem-loofah: Uncontrolled Recursion leading to denial of service
Overview
Description
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Loofah >= 2.2.0, < 2.19.1 uses recursion for sanitizing CDATA sections, making it susceptible to stack exhaustion and raising a SystemStackError exception. This may lead to a denial of service through CPU resource consumption. This issue is patched in version 2.19.1. Users who are unable to upgrade may be able to mitigate this vulnerability by limiting the length of the strings that are sanitized.
Source: OX vulnerability database
Severity
7.5 · HIGH
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness: CWE-674
Affected packages · 1
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| RubyGems | loofah | >=2.2.0, <2.19.1 | 2.19.1 |
Open a package to see all its vulnerabilities.
Operating systems · 14 fixes
Red Hat 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 7 | tfm-rubygem-loofah | affected |
SUSE Linux Enterprise 1 release · 1 package
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | ruby2-5-rubygem-loofah | 2.2.2-150000.4.9.1 | SUSE-SU-2023:1657-1 |
debian 5 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 10 | ruby-loofah | 2.2.3-1+deb10u2 |
| 11 | ruby-loofah | 2.7.0+dfsg-1+deb11u1 |
| 12 | ruby-loofah | 2.19.1-1 |
| 13 | ruby-loofah | 2.19.1-1 |
| 14 | ruby-loofah | 2.19.1-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| ruby-loofah | 2.19.1-1 |
openSUSE 1 release · 4 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | ruby3-1-rubygem-loofah +1 | 2.19.1-1.1 | openSUSE-SU-2024:12768-1 |
| Tumbleweed | ruby3-3-rubygem-loofah | 2.22.0-1.5 | openSUSE-SU-2024:14171-1 |
| Tumbleweed | ruby3-4-rubygem-loofah | 2.23.1-1.3 | openSUSE-SU-2025:15120-1 |
| Tumbleweed | ruby4-0-rubygem-loofah | 2.23.1-1.5 | openSUSE-SU-2026:10353-1 |
seal Red Hat 2 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 7 | python-jinja2 +1 | 2.7.2-4.el7+sp999 |
| 8 | libsolv +1 | 0.7.20-6.el8+sp999 |
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2022-23516
- cwe.mitre.org https://cwe.mitre.org/data/definitions/674.html
- github.com https://github.com/flavorjones/loofah
- github.com https://github.com/flavorjones/loofah/commit/86f7f6364491b0099d215db858ecdc0c89ded040
- github.com https://github.com/flavorjones/loofah/security/advisories/GHSA-3x8r-x6xp-q4vm
- github.com https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/CVE-2022-23516.yml
- lists.debian.org https://lists.debian.org/debian-lts-announce/2023/09/msg00011.html
- lists.debian.org https://lists.debian.org/debian-lts-announce/2024/09/msg00044.html
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2022-23516
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2022-23516
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.