7.5high
Uncontrolled Recursion in Loofah
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.17% (higher than 68% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-3x8r-x6xp-q4vm
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| flavorjones loofah | >= 2.2.0, < 2.19.1 | CVE List |
| loofah (RubyGems) | from 2.2.0 before 2.19.1 | GitHub Advisory Database |
| loofah_project loofah | from 2.2.0 before 2.19.1 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Summary
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.
Mitigation
Upgrade to Loofah >= 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.
Severity
The Loofah maintainers have evaluated this as High Severity 7.5 (CVSS3.1).
References
NVD (es)
Loofah es una librería general para manipular y transformar documentos y fragmentos HTML/XML, construida sobre Nokogiri. Loofah versiones >= 2.2.0 y < 2.19.1 usa recursividad para sanitizar secciones CDATA, lo que la hace susceptible al agotamiento de la pila de memoria y genera una excepción SystemStackError. Esto puede provocar una denegación de servicio debido al consumo de recursos de la CPU. Este problema se solucionó en la versión 2.19.1. Los usuarios que no puedan actualizar pueden mitigar esta vulnerabilidad limitando la longitud de las cadenas que se sanitizan.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-23516 changed 2025-11-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3x8r-x6xp-q4vm changed 2025-11-04 | CC-BY-4.0 |
| NVD | CVE-2022-23516 changed 2026-06-17 | Public domain |