Record summary

CVE-2021-21349 has a selected CVSS score of 6.1 (medium); EIP currently links 1 repository PoC and 1 lab environment.

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 which may allow a remote attacker to request data from internal resources that are not publicly available only by manipulating the processed input stream. 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.

Description source: CVE List

Exploitation context

Available material

Repository PoCs
1
Lab environments
1

Affected products and versions

2
ProductSourceVersion rangeStatus
CVE List< 1.4.16affected

com.thoughtworks.xstream:xstream

Browse Maven / com.thoughtworks.xstream:xstream
GitHub AdvisoryBefore 1.4.16 · Fixed in 1.4.16affected

Proofs of concept

1

Repository PoCs

GitHubs-index/CVE-2021-21349Repository PoCby s-indexStars: 1Not analyzed5 files

7.1 KiB

GitHub

PoC details

Docker lab environments

1
GitHub

Repository root

s-index/CVE-2021-21349Created
Vuln labCVE-2021-21349Dockerfile

1 Dockerfile

Analysisdeepseek-v4-pro:cloud ·

Environment assessment

A single-container Java environment that builds and runs an XStream 1.4.15 application designed to demonstrate CVE-2021-21349, a Server-Side Request Forgery (SSRF) vulnerability.

Dockerfile:1-6pom.xml:1-44README.md:1-74

Lab assessment

Vulnerability lab

The README explicitly describes CVE-2021-21349, provides a proof-of-concept (PoC) execution, and includes a vulnerable XStream version (1.4.15) in pom.xml. The Java source code contains a hardcoded XML payload that triggers an SSRF to http://host.docker.internal:8080/internal.txt, matching the vulnerability description.

README.md:1-74pom.xml:12-15src/main/java/main.java:1-56
Lab shapeDockerfile
ServicesUnknown
Compose manifests0
Dockerfiles1
Evidence & reasoningComponents · CVE assessment · exercise context · review boundaries
Components

Services and files described by the evidence

Dockerfile

builds the vulnerable applicationdefines the runtime environment

Uses maven:3.8.1-amazoncorretto-8 as the base image, copies the entire build context into /tmp, runs 'mvn package' to build the application, and sets the default command to execute the resulting JAR.

Dockerfile:1-6

pom.xml

declares the vulnerable XStream dependencyconfigures the build process

Maven project file that includes com.thoughtworks.xstream:xstream:1.4.15 as a dependency and uses the maven-shade-plugin to create an executable JAR with main class 'main'.

pom.xml:1-44

main.java

contains the hardcoded exploit payloadtriggers the SSRF vulnerability

Java source code that creates an XStream instance and calls fromXML() with a crafted XML string. The payload uses a gadget chain to make an HTTP request to http://host.docker.internal:8080/internal.txt, demonstrating the SSRF.

src/main/java/main.java:1-56

internal.txt

target resource for the SSRF demonstration

A simple text file containing 'internal file' that is served by a Python HTTP server on the host and requested by the exploit payload.

internal.txt:1

README.md

documents the vulnerability and lab setupprovides PoC execution instructions

Explains CVE-2021-21349, shows a demo GIF, and gives step-by-step instructions to build the Docker image, run a Python HTTP server, and execute the container to trigger the SSRF.

README.md:1-74
CVE assessment

How the supplied evidence relates each vulnerability

CVE-2021-21349

Supported by supplied evidence

The lab uses XStream 1.4.15 (pom.xml line 14), which is within the affected version range. The Java code (main.java) demonstrates unmarshalling a crafted XML that causes a server-side request to an arbitrary URL (http://host.docker.internal:8080/internal.txt), matching the CVE description of an SSRF via XStream unmarshalling.

pom.xml:12-15src/main/java/main.java:1-56README.md:1-10
Exercise context

Requirements and sequence described by the evidence

Prerequisites

  • Docker must be installed to build and run the image.README.md:25-27
  • A Python HTTP server must be running on the host on port 8080 to serve internal.txt.README.md:29-31
  • The container must be run with network access to the host (host.docker.internal) to reach the HTTP server.src/main/java/main.java:27

Evidence-described exercise path

  1. Build the Docker image using 'docker build -t cve-2021-21349 .'README.md:25-27
  2. Start a Python HTTP server on the host with 'python -m http.server 8080'README.md:29-31
  3. Run the container with 'docker run -it --rm cve-2021-21349' to execute the Java application, which will trigger the SSRF and request internal.txt from the host's HTTP server.README.md:33-35
Safety-review evidence

Behaviors behind the stored safety assessment

No harmful behavior observed

The visible behavior is limited to building and running a Java application that makes a single HTTP GET request to a user-controlled host service (http://host.docker.internal:8080/internal.txt). This is the intended demonstration of the SSRF vulnerability. There is no evidence of host escape, persistence, credential theft, data destruction, or connections to external systems beyond the documented lab target.

src/main/java/main.java:1-56README.md:1-74Dockerfile:1-6
Review boundaries

What the analysis did not establish

  • The Dockerfile does not specify a non-root user; the application runs as the default user in the base image, which may be root, but no privilege escalation or host compromise is demonstrated.
  • The lab relies on host.docker.internal for network connectivity, which is a Docker Desktop feature and may not work in all Docker environments.
  • The packet does not include the actual JAR file or build output; only source code and build instructions are provided.
Model interpretation

This review is limited to the supplied lab evidence packet. It does not assert that the environment runs, reproduces a vulnerability, or is safe to execute. Contract: eip-docker-lab-analysis-v1.

References

Showing 12 of 22