VYPR
High severityNVD Advisory· Published Sep 16, 2022· Updated Apr 21, 2025

Stack Buffer Overflow in xstream

CVE-2022-40151

Description

Those using Xstream to seralize XML data may be vulnerable to Denial of Service attacks (DOS). If the parser is running on user supplied input, an attacker may supply content that causes the parser to crash by stackoverflow. This effect may support a denial of service attack.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

XStream versions up to 1.4.19 are vulnerable to denial of service via stack overflow when unmarshalling deeply nested XML objects.

Description

XStream, a Java library for serializing objects to XML and back, is vulnerable to a denial of service (DoS) attack due to a stack overflow. The vulnerability arises because XStream processes type information from the input stream during unmarshalling to recreate objects. An attacker can craft XML input containing deeply nested elements, causing the recursion depth to exceed the stack limit and resulting in a stack overflow error [2].

Exploitation

An attacker can exploit this vulnerability by supplying a malicious XML payload to an application that uses XStream to unmarshal user-supplied data. No authentication is required; the attacker only needs to be able to send the crafted input to the parser. The provided proof-of-concept demonstrates that nesting 10,000 `` elements is sufficient to trigger the overflow [2].

Impact

Successful exploitation causes the executing thread to abort with a StackOverflowError, leading to a denial of service. The application may become unresponsive or crash, depending on how the error is handled [4].

Mitigation

XStream version 1.4.20 addresses the issue by catching the StackOverflowError and throwing an InputManipulationException instead, preventing the crash. Users should upgrade to this version or later. As a workaround, client code can catch StackOverflowError when calling XStream [2][4].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
com.thoughtworks.xstream:xstreamMaven
< 1.4.201.4.20

Affected products

16

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

7

News mentions

0

No linked articles in our index yet.