Uncontrolled Recursion Affecting loofah package, versions >=2.2.0, <2.19.1


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.1% (44th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-LOOFAH-3168649
  • published14 Dec 2022
  • disclosed13 Dec 2022
  • creditUnknown

Introduced: 13 Dec 2022

CVE-2022-23516  (opens in a new tab)
CWE-674  (opens in a new tab)

How to fix?

Upgrade loofah to version 2.19.1 or higher.

Overview

loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri.

Affected versions of this package are vulnerable to Uncontrolled Recursion when it uses recursion for sanitizing CDATA sections, making it susceptible to stack exhaustion and raising a SystemStackError exception, which might result in CPU resource consumption.

Workaround

Users who are unable to upgrade may be able to mitigate this vulnerability by limiting the length of the strings that are sanitized.

CVSS Scores

version 3.1