# CVE-2021-21342: A Server-Side Forgery Request can be activated unmarshalling with XStream to access data streams from an arbitrary URL referencing a resource in an intranet or the local host

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; User interaction: Required; Scope: Unchanged; Confidentiality impact: None; Integrity impact: High; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 49.99% (percentile 99, 2026-11-28)
- **CWE:** CWE-502, CWE-918
- **Aliases:** BIT-activemq-2021-21342, GHSA-hvv8-336g-rx3m
- **Published:** 2021-03-22T23:28:01.000Z
- **Modified:** 2026-10-07T19:17:20.313Z

## Who should check

- Projects that depend on Maven package com.thoughtworks.xstream:xstream (\< 1.4.16)
- Anyone running x-stream xstream \< 1.4.16

## Description

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. XStream creates therefore new instances based on these type information. 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. If you rely on XStream's default blacklist of the Security Framework, you will have to use at least version 1.4.16.

## Affected and fixed versions

- Maven `com.thoughtworks.xstream:xstream`: affected \< 1.4.16; fixed 1.4.16 (osv)
- x-stream xstream: \< 1.4.16 (cvelist)

## Mitigation

- Upgrade com.thoughtworks.xstream:xstream to 1.4.16 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-21342. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-21342.md
Affected: com.thoughtworks.xstream:xstream < 1.4.16
Fixed in: 1.4.16

Steps:
1. Search this machine and project for com.thoughtworks.xstream:xstream (Maven), x-stream xstream: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-21342 being exploited?

There is no confirmed exploitation: CVE-2021-21342 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 49.99% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2021-21342?

Medium: CVSS 5.3 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2021-21342?

com.thoughtworks.xstream:xstream \< 1.4.16.

### Is there a fix for CVE-2021-21342?

Yes. Fixed in 1.4.16. Upgrade com.thoughtworks.xstream:xstream to 1.4.16 or later.

### How do I check if I'm affected by CVE-2021-21342?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/x-stream/xstream/security/advisories/GHSA-hvv8-336g-rx3m>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/22KVR6B5IZP3BGQ3HPWIO2FWWCKT3DHP/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QGXIU3YDPG6OGTDHMBLAFN7BPBERXREB/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PVPHZA7VW2RRSDCOIPP2W6O5ND254TU7/>
- vendor: <https://www.debian.org/security/2021/dsa-5004>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-21342>
- patch: <https://www.oracle.com/security-alerts/cpujan2022.html>
- exploit: <https://x-stream.github.io/CVE-2021-21342.html>
- other: <https://x-stream.github.io/security.html#workaround>
- other: <http://x-stream.github.io/changes.html#1.4.16>
- other: <https://lists.debian.org/debian-lts-announce/2021/04/msg00002.html>
- other: <https://lists.apache.org/thread.html/r9ac71b047767205aa22e3a08cb33f3e0586de6b2fac48b425c6e16b0%40%3Cdev.jmeter.apache.org%3E>
- other: <https://lists.apache.org/thread.html/r8244fd0831db894d5e89911ded9c72196d395a90ae655414d23ed0dd%40%3Cusers.activemq.apache.org%3E>
- other: <https://security.netapp.com/advisory/ntap-20210430-0002/>
- other: <https://www.oracle.com//security-alerts/cpujul2021.html>
- other: <https://www.oracle.com/security-alerts/cpuoct2021.html>
- other: <https://github.com/x-stream/xstream>
- other: <https://lists.apache.org/thread.html/r8244fd0831db894d5e89911ded9c72196d395a90ae655414d23ed0dd@%3Cusers.activemq.apache.org%3E>
- other: <https://lists.apache.org/thread.html/r9ac71b047767205aa22e3a08cb33f3e0586de6b2fac48b425c6e16b0@%3Cdev.jmeter.apache.org%3E>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/22KVR6B5IZP3BGQ3HPWIO2FWWCKT3DHP>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PVPHZA7VW2RRSDCOIPP2W6O5ND254TU7>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QGXIU3YDPG6OGTDHMBLAFN7BPBERXREB>
- other: <https://security.netapp.com/advisory/ntap-20210430-0002>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-21342>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-hvv8-336g-rx3m> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-21342> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-21342>
