XStream pre-1.4.20: Remote DoS via Recursive Hash in Object Serialization
CVE-2022-41966 Published on December 28, 2022

XStream Denial of Service via stack overflow
XStream serializes Java objects to XML and back again. Versions prior to 1.4.20 may allow a remote attacker to terminate the application with a stack overflow error, resulting in a denial of service only via manipulation the processed input stream. The attack uses the hash code implementation for collections and maps to force recursive hash calculation causing a stack overflow. This issue is patched in version 1.4.20 which handles the stack overflow and raises an InputManipulationException instead. A potential workaround for users who only use HashMap or HashSet and whose XML refers these only as default map or set, is to change the default implementation of java.util.Map and java.util per the code example in the referenced advisory. However, this implies that your application does not care about the implementation of the map and all elements are comparable.

Github Repository NVD

Vulnerability Analysis

CVE-2022-41966 is exploitable with network access, and does not require authorization privileges or user interaction. This vulnerability is considered to have a low attack complexity. An automatable proof of concept (POC) exploit exists. The potential impact of an exploit of this vulnerability is considered to have no impact on confidentiality, with no impact on integrity, and a high impact on availability.

Attack Vector:
NETWORK
Attack Complexity:
LOW
Privileges Required:
NONE
User Interaction:
NONE
Scope:
UNCHANGED
Confidentiality Impact:
NONE
Integrity Impact:
LOW
Availability Impact:
HIGH

Weakness Types

What is a Classic Buffer Overflow Vulnerability?

The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.

CVE-2022-41966 has been classified to as a Classic Buffer Overflow vulnerability or weakness.

What is a Stack Overflow Vulnerability?

A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).

CVE-2022-41966 has been classified to as a Stack Overflow vulnerability or weakness.

What is a Marshaling, Unmarshaling Vulnerability?

The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.

CVE-2022-41966 has been classified to as a Marshaling, Unmarshaling vulnerability or weakness.


Products Associated with CVE-2022-41966

You can be notified by email with stack.watch whenever vulnerabilities like CVE-2022-41966 are published in these products:

 
 
 

Affected Versions

x-stream xstream Version < 1.4.20 is affected by CVE-2022-41966

Vulnerable Packages

The following package name and versions may be associated with CVE-2022-41966

Package Manager Vulnerable Package Versions Fixed In
maven com.thoughtworks.xstream:xstream < 1.4.20 1.4.20

Exploit Probability

EPSS
2.38%
Percentile
85.28%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.