Denial of Service Vulnerability in libxstream-java: Stack Overflow Risk

libxstream-java Updated 02 Oct 2025

Summary

28/12/2022
N/A
Yes i
High
8.2

UBUNTU-CVE-2022-41966: XStream serializes Java objects to XML and back again. Affects libxstream-java versions < 1.4.7-1ubuntu0.1+esm1. Fixed in 1.4.7-1ubuntu0.1+esm1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

libxstream-java is a library that facilitates the serialization of Java objects to XML and vice versa. It is widely used in Java applications for data exchange and persistence. The library's functionality allows developers to easily convert complex Java objects into XML format, making it easier to store and transmit data. However, certain versions of libxstream-java are vulnerable to a denial of service attack due to improper handling of input streams, which can lead to application crashes.

Vulnerability Detail

The vulnerability identified as CVE-2022-41966 affects versions of libxstream-java prior to 1.4.20. It allows a remote attacker to exploit the library by manipulating the processed input stream, leading to a stack overflow error. This occurs due to the hash code implementation for collections and maps, which can force recursive hash calculations, ultimately causing the application to terminate unexpectedly. The severity of this vulnerability is rated at CVSS 8.2, indicating a high risk of denial of service.

How To Fix

Minimum fixed version

1.4.7-1ubuntu0.1+esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libxstream-java

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

For users who are unable to immediately update the package, a potential workaround is to change the default implementation of java.util.Map and java.util to avoid using HashMap or HashSet. This can be done by implementing a custom map that does not rely on the default hash code calculations. Here is a code example:

import java.util.Map;
import java.util.HashMap;

public class CustomMap extends HashMap<String, String> {
    // Custom implementation to avoid stack overflow
}

Conclusion

In summary, CVE-2022-41966 poses a significant risk to applications using vulnerable versions of libxstream-java, allowing for denial of service attacks through stack overflow errors. It is crucial to update to version 1.4.20 or later to mitigate this risk. Users should also consider the provided workaround if immediate updates are not feasible.

See every vulnerability recorded for libxstream-java →

Share this vulnerability

FAQ

CVE-2022-41966 is a vulnerability in libxstream-java that allows for denial of service attacks through stack overflow errors caused by manipulated input streams.

Versions prior to 1.4.20 of libxstream-java are affected by this vulnerability.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If you cannot update the package, consider implementing a custom map to avoid using HashMap or HashSet as a temporary workaround.

The CVSS score of CVE-2022-41966 is 8.2, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for libxstream-java.

How To Fix

Minimum fixed version

1.4.7-1ubuntu0.1+esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libxstream-java

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback