Uncontrolled Recursion in Loofah
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2022-23516
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 07:11 UTC · Revision 1
Source evidence
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.
osv:CVE-2022-23516
Complete source record
{
"id": "41155597ed1456628c368d87d4009379bc92e4db658d9710e2784610436588cf",
"url": "https://osv.dev/vulnerability/CVE-2022-23516",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Uncontrolled Recursion in Loofah",
"summary": "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.",
"evidence": "osv:CVE-2022-23516",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2022-23516",
"aliases": [
"CVE-2022-23516",
"GHSA-3x8r-x6xp-q4vm"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/flavorjones/loofah",
"type": "GIT",
"events": [
{
"introduced": "adc0c3ffd5a704a346a7fb4f7eff4d53a8613303"
},
{
"fixed": "3f8806300089135f7832a59aa2689a6674d37897"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "2.2.0"
},
{
"fixed": "2.19.1"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"cpe": "cpe:2.3:a:loofah_project:loofah:*:*:*:*:*:ruby:*:*",
"range": [
{
"introduced": "2.2.0"
},
{
"fixed": "2.19.1"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"v2.19.0",
"v2.18.0",
"v2.17.0",
"v2.16.0",
"v2.15.0",
"v2.14.0",
"v2.13.0",
"v2.12.0",
"v2.11.0",
"v2.10.0",
"v2.9.1",
"v2.9.0",
"v2.8.0",
"v2.7.0",
"v2.6.0",
"v2.5.0",
"v2.4.0",
"v2.3.1",
"v2.3.0",
"v2.2.2",
"v2.2.1",
"v2.2.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-23516.json"
}
}
],
"modified": "2026-10-28T02:30:26.909727194Z",
"provider": "osv",
"references": [
"https://lists.debian.org/debian-lts-announce/2023/09/msg00011.html",
"https://lists.debian.org/debian-lts-announce/2024/09/msg00044.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/23xxx/CVE-2022-23516.json",
"https://github.com/flavorjones/loofah/security/advisories/GHSA-3x8r-x6xp-q4vm",
"https://nvd.nist.gov/vuln/detail/CVE-2022-23516"
],
"provider_metadata": {
"cwe_ids": [
"CWE-674"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/23xxx/CVE-2022-23516.json"
}
},
"related_cves": [
{
"value": "CVE-2022-23516",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 493287,
"published_at": "2022-12-14T13:26:11.741+00:00"
}