Miggo Logo

CVE-2022-41966: XStream can cause Denial of Service via stack overflow

8.2

CVSS Score
3.1

Basic Information

EPSS Score
0.89094%
Published
12/29/2022
Updated
6/27/2023
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
com.thoughtworks.xstream:xstreammaven< 1.4.201.4.20

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from XStream's collection converters allowing unlimited recursion during deserialization of Java collection types. Specifically:

  1. MapConverter handles HashMap/LinkedHashMap/Hashtable deserialization
  2. SetConverter handles HashSet/LinkedHashSet deserialization These converters reconstruct collection objects from XML without proper depth validation, enabling attackers to craft nested structures that force recursive hashCode() calls. The hash code implementations of these collections recursively calculate member hashes, leading to stack overflow. The workarounds explicitly mention denying these collection types, confirming their converters' involvement. The patch in 1.4.20 likely adds recursion depth checks in these conversion paths.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t T** vuln*r**ility m*y *llow * r*mot* *tt**k*r to t*rmin*t* t** *ppli**tion wit* * st**k ov*r*low *rror r*sultin* in * **ni*l o* s*rvi** only *y m*nipul*tin* t** pro**ss** input str**m. ### P*t***s XStr**m *.*.** **n*l*s t** st**k ov*r*low

Reasoning

T** vuln*r**ility st*ms *rom XStr**m's *oll**tion *onv*rt*rs *llowin* unlimit** r**ursion *urin* **s*ri*liz*tion o* J*v* *oll**tion typ*s. Sp**i*i**lly: *. M*p*onv*rt*r **n*l*s **s*M*p/Link****s*M*p/**s*t**l* **s*ri*liz*tion *. S*t*onv*rt*r **n*l*s *