Miggo Logo

CVE-2022-40151: XStream can cause a Denial of Service by injecting deeply nested objects raising a stack overflow

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.42223%
Published
12/30/2022
Updated
1/7/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:N/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 uncontrolled recursion during XML unmarshalling of deeply nested structures. The TreeUnmarshaller.startElement method is responsible for processing nested elements recursively. Pre-1.4.20 versions lacked depth tracking in this critical path, allowing attackers to craft malicious payloads that exhaust the call stack. The patch in 1.4.20 introduced depth validation in this unmarshalling process, confirming this as the vulnerable code path.

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 un*ontroll** r**ursion *urin* XML unm*rs**llin* o* ***ply n*st** stru*tur*s. T** `Tr**Unm*rs**ll*r.st*rt*l*m*nt` m*t*o* is r*sponsi*l* *or pro**ssin* n*st** *l*m*nts r**ursiv*ly. Pr*-*.*.** v*rsions l**k** **pt* tr**kin*