CVE-2021-21342
Java vulnerability analysis and mitigation

Overview

XStream is a Java library to serialize objects to XML and back again. In XStream before version 1.4.16, there is a vulnerability where the processed stream at unmarshalling time contains type information to recreate the formerly written objects. An attacker can manipulate the processed input stream and replace or inject objects, that result in a server-side forgery request. No user is affected, who followed the recommendation to setup XStream's security framework with a whitelist limited to the minimal required types (GitHub Advisory, XStream CVE).

Technical details

The vulnerability exists in the unmarshalling process where XStream creates new instances based on type information contained in the processed stream. The attack can be performed by creating a simple PriorityQueue, marshalling it to XML, and then replacing the XML with malicious content that triggers a server-side request forgery. This vulnerability works with both XML and JSON formats (XStream CVE).

Impact

The vulnerability may allow a remote attacker to request data from internal resources that are not publicly available only by manipulating the processed input stream. This could potentially expose sensitive information from intranet or localhost resources (GitHub Advisory, XStream CVE).

Exploitability

The vulnerability has a CVSS v3.1 base score of 9.1 (Critical) with attack vector being Network, attack complexity Low, requiring no privileges or user interaction. The scope is Unchanged with High impact on both Confidentiality and Integrity (NVD).

Mitigation and workarounds

Users should upgrade to XStream version 1.4.16 or later. For those who cannot upgrade immediately, it is recommended to setup XStream's security framework with a whitelist limited to the minimal required types. The security framework has been available since version 1.4.7 and allows defining which types are allowed to be unmarshalled (XStream Security).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-76904CRITICAL9.8
  • Java logoJava
  • org.geotools.jdbc:gt-jdbc-postgis
NoYesAug 21, 2026
GHSA-mqjf-5f49-2fjhCRITICAL9.8
  • Java logoJava
  • org.geotools:gt-jdbc-postgis
NoYesAug 21, 2026
CVE-2026-61827HIGH8.7
  • Java logoJava
  • io.netty.incubator:netty-incubator-codec-bhttp
NoYesAug 20, 2026
CVE-2026-63202HIGH7.5
  • Java logoJava
  • io.netty.incubator:netty-incubator-codec-bhttp
NoYesAug 20, 2026
CVE-2026-63124HIGH7.5
  • Java logoJava
  • io.netty.incubator:netty-incubator-codec-bhttp
NoYesAug 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management