High severityNVD Advisory· Published Dec 14, 2022· Updated Nov 3, 2025
Uncontrolled Recursion in Loofah
CVE-2022-23516
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
loofahRubyGems | >= 2.2.0, < 2.19.1 | 2.19.1 |
Affected products
8- ghsa-coords7 versionspkg:gem/loofahpkg:rpm/opensuse/rubygem-loofah&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/rubygem-loofah&distro=openSUSE%20Tumbleweedpkg:rpm/suse/rubygem-loofah&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP1pkg:rpm/suse/rubygem-loofah&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP2pkg:rpm/suse/rubygem-loofah&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP3pkg:rpm/suse/rubygem-loofah&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP4
>= 2.2.0, < 2.19.1+ 6 more
- (no CPE)range: >= 2.2.0, < 2.19.1
- (no CPE)range: < 2.2.2-150000.4.9.1
- (no CPE)range: < 2.19.1-1.1
- (no CPE)range: < 2.2.2-150000.4.9.1
- (no CPE)range: < 2.2.2-150000.4.9.1
- (no CPE)range: < 2.2.2-150000.4.9.1
- (no CPE)range: < 2.2.2-150000.4.9.1
- Range: >= 2.2.0, < 2.19.1
Patches
Vulnerability mechanics
References
7- github.com/advisories/GHSA-3x8r-x6xp-q4vmghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-23516ghsaADVISORY
- github.com/flavorjones/loofah/commit/86f7f6364491b0099d215db858ecdc0c89ded040ghsaWEB
- github.com/flavorjones/loofah/security/advisories/GHSA-3x8r-x6xp-q4vmghsax_refsource_CONFIRMWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/CVE-2022-23516.ymlghsaWEB
- lists.debian.org/debian-lts-announce/2023/09/msg00011.htmlghsaWEB
- lists.debian.org/debian-lts-announce/2024/09/msg00044.htmlghsaWEB
News mentions
0No linked articles in our index yet.