LiveActive security incident?Get immediate response
CVE Record

CVE-2022-23516: 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.

HighCVSS 7.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

Loofah versions before 2.19.1 can be forced into excessive recursion while sanitizing CDATA, causing stack exhaustion and service failure. The business risk is availability: exposed applications that sanitize attacker-controlled HTML or XML may become unstable or unavailable.

Executive priority

Treat as a high-priority availability fix for internet-facing or customer-content services using Loofah. It does not indicate data theft or code execution in the provided sources, but a reliable crash path can still create operational disruption.

Technical view

CVE-2022-23516 is a CWE-674 uncontrolled recursion flaw in Loofah >= 2.2.0 and < 2.19.1. Recursive CDATA sanitization can raise SystemStackError and consume CPU, producing denial of service. The published fix is Loofah 2.19.1.

Likely exposure

Exposure is likely in Ruby applications or packaged environments using vulnerable Loofah versions to sanitize untrusted HTML/XML fragments, especially where user-controlled CDATA reaches sanitization paths. Evidence does not identify other affected products beyond Loofah and downstream Debian package handling.

Exploitation context

The CVSS vector is network-accessible, low complexity, no privileges, no user interaction, with high availability impact. The source bundle does not show CISA KEV listing or confirmed active exploitation, so exploitation should be treated as plausible but not proven active.

Researcher notes

Focus validation on version range and reachability of CDATA sanitization. Avoid assuming exploit-in-the-wild status. Debian advisories indicate downstream maintenance activity, but the core upstream remediation named in the bundle is Loofah 2.19.1.

Mitigation direction

  • Upgrade Loofah to 2.19.1 or a vendor-supported fixed package.
  • If upgrade is blocked, limit sanitized string length as vendor advisory suggests.
  • Prioritize services sanitizing externally supplied HTML, XML, or CDATA content.
  • Check Debian LTS advisories if consuming Loofah from Debian packages.

Validation and detection

  • Inventory Ruby dependency manifests and lockfiles for Loofah versions.
  • Confirm deployed artifacts resolve Loofah outside the vulnerable range.
  • Identify code paths that sanitize untrusted HTML/XML input.
  • Review monitoring for SystemStackError or unusual sanitizer CPU spikes.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-674: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2022-23516 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
4Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H3.93.6Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.5High
CVSS 3.1 vector shape for CVE-2022-23516Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
flavorjonesloofah>= 2.2.0, < 2.19.1Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-674 · source CWE mapping

Uncontrolled Recursion

Uncontrolled Recursion represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.