CVE-2022-23516: Uncontrolled Recursion in Loofah
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.06665%
CWE
Published
12/13/2022
Updated
9/14/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
loofah | rubygems | >= 2.2.0, < 2.19.1 | 2.19.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from recursive CDATA sanitization in Loofah versions <2.19.1. The commit diff shows the vulnerable code in scrubbers.rb
's Strip#scrub
method contained a conditional that recursively sanitized CDATA children using Loofah's own scrubber. This created uncontrolled recursion depth when processing nested CDATA. The patch removed this recursive pattern and replaced it with direct node manipulation and escaping logic in html5/scrub.rb
, confirming the original scrub method was the recursion point.