# CVE-2022-23516: Uncontrolled Recursion in Loofah

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.17%, higher than 68% of CVEs (2026-12-01)
- Published: 2022-12-13T17:40:50.000Z
- Modified: 2026-06-17T04:30:16.837Z
- Also known as: GHSA-3x8r-x6xp-q4vm
- Weaknesses: CWE-674
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- flavorjones loofah: >= 2.2.0, < 2.19.1
- loofah (RubyGems): from 2.2.0 before 2.19.1
- loofah_project loofah: from 2.2.0 before 2.19.1

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/flavorjones/loofah/security/advisories/GHSA-3x8r-x6xp-q4vm> (third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2023/09/msg00011.html> (web)
- <https://lists.debian.org/debian-lts-announce/2024/09/msg00044.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-23516> (advisory)
- <https://github.com/flavorjones/loofah/commit/86f7f6364491b0099d215db858ecdc0c89ded040> (web)
- <https://github.com/flavorjones/loofah> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/CVE-2022-23516.yml> (web)

## Sources

- CVE List: [CVE-2022-23516](https://www.cve.org/CVERecord?id=CVE-2022-23516), CVE Terms of Use, modified 2025-11-03
- GitHub Advisory Database: [GHSA-3x8r-x6xp-q4vm](https://github.com/advisories/GHSA-3x8r-x6xp-q4vm), CC-BY-4.0, modified 2025-11-04
- NVD: [CVE-2022-23516](https://nvd.nist.gov/vuln/detail/CVE-2022-23516), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-23516 · Whole record: https://cve.day/CVE-2022-23516.json · Rebuilt by cve.day 2026-11-25T22:58:17.525Z
