Loading...
Skip to main content

CVE-2022-23516 — Uncontrolled Recursion in loofah — CVE Details

HIGH

Uncontrolled Recursion in Loofah

Published December 13, 2022Updated November 4, 2025Source: osv

Summary

## 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)](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). ## References - [CWE - CWE-674: Uncontrolled Recursion (4.9)](https://cwe.mitre.org/data/definitions/674.html)

Advisory Timeline

  • First published December 13, 2022 (1399 days ago).
  • Last revised November 4, 2025 — 1057 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update loofah to 2.19.1 or later
gem install loofah -v 2.19.1

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
loofah
rubygems
2.10.0, 2.11.0, 2.12.0, 2.13.0 (+19 more)2.19.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

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

Frequently Asked Questions

What is CVE-2022-23516?
Uncontrolled Recursion in Loofah This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2022-23516?
CVE-2022-23516 affects loofah. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-23516 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-3x8r-x6xp-q4vm

Related CVEs

  • CVE-2026-94462
    HIGH

    Spree: Broken Access Control in `PATCH /api/v3/store/carts/:id/associate` (IDOR)

  • CVE-2022-23514
    HIGH

    Inefficient Regular Expression Complexity in Loofah

  • CVE-2026-77601
    HIGH

    OpenC3 COSMOS: Authenticated OS command injection via the `pypi_url` setting

  • CVE-2022-23515
    MEDIUM

    Improper neutralization of data URIs may allow XSS in Loofah

  • CVE-2026-73490
    MEDIUM

    Loofah: SVG `href` attribute bypasses local-reference restriction

  • GHSA-46fp-8f5p-pf2m
    LOW

    Improper detection of disallowed URIs by Loofah `allowed_uri?`

  • CVE-2026-73492
    LOW

    Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons

  • CVE-2026-73491
    LOW

    Loofah `allowed_uri?` does not detect `javascript:` URIs split by named whitespace character references

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies