CVE-2022-23514
JSON

7.5high

Inefficient Regular Expression Complexity in Loofah

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
1.84% (higher than 79% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-486f-hjj9-9vhh

Description

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Loofah < 2.19.1 contains an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption. This issue is patched in version 2.19.1.

Affected

Product or packageVersionsReported by
flavorjones loofah< 2.19.1CVE List
loofah (RubyGems)before 2.19.1GitHub Advisory Database
loofah_project loofahbefore 2.19.1NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-1333

SSVC (CISA-ADP): exploitation poc, 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.19.1 contains an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption. This issue is patched in version 2.19.1.

GitHub Advisory Database

Summary

Loofah < 2.19.1 contains an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption.

Mitigation

Upgrade to Loofah >= 2.19.1.

Severity

The Loofah maintainers have evaluated this as High Severity 7.5 (CVSS3.1).

References

Credit

This vulnerability was responsibly reported by @ooooooo-q (https://github.com/ooooooo-q).

NVD (es)

Loofah es una librería general para manipular y transformar documentos y fragmentos HTML / XML, construida sobre Nokogiri. Loofah &lt; 2.19.1 contiene una expresión regular ineficiente que es susceptible a un retroceso excesivo al intentar sanitizar ciertos atributos SVG. Esto puede provocar una denegación de servicio a través del consumo de recursos de CPU. Este problema está parcheado en la versión 2.19.1.

References

Sources

SourceRecordLicence
CVE ListCVE-2022-23514 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-486f-hjj9-9vhh changed 2025-11-04CC-BY-4.0
NVDCVE-2022-23514 changed 2026-06-17Public domain