CVE-2016-3674: XML External Entity Injection in XStream

Summary

30/06/2020
Yes i
High
7.5

CVE-2016-3674: XML External Entity Injection in XStream. Affects com.thoughtworks.xstream:xstream versions < 1.4.9. Fixed in 1.4.9. How to fix ↓

Also tracked for

The same CVE-2016-3674 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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

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

XStream is a Java library that provides a simple way to serialize objects to XML and back again. It is widely used in various applications and frameworks for data serialization and deserialization. XStream supports multiple XML drivers, including Dom4JDriver, DomDriver, JDomDriver, JDom2Driver, SjsxpDriver, StandardStaxDriver, and WstxDriver. These drivers are responsible for parsing XML documents and converting them into Java objects. However, versions of XStream before 1.4.9 are vulnerable to XML external entity (XXE) injection attacks.

Vulnerability Detail

The vulnerability allows remote attackers to read arbitrary files by exploiting the XXE vulnerability in the XML parsing process. By crafting a malicious XML document, an attacker can include external entities that reference sensitive files on the server. When the XML document is processed by XStream, the parser resolves these entities and discloses the contents of the referenced files. This can lead to unauthorized access to sensitive information, such as configuration files, credentials, or other sensitive data stored on the server.

How To Fix

Latest published version: 1.4.21 as of 22 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.4.9

This is the first release that contains the fix.

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

Workaround

If upgrading to the latest version of XStream is not immediately feasible, a temporary workaround is to disable external entity resolution manually. This can be done by configuring the XML parser used by XStream to disallow the processing of external entities. The specific steps to implement this workaround may vary depending on the XML parser being used. Here is an example of how to disable external entity resolution using the Woodstox XML parser:

  1. Add the Woodstox dependency to your project:
<dependency>
  <groupId>com.fasterxml.woodstox</groupId>
  <artifactId>woodstox-core</artifactId>
  <version>6.2.4</version>
</dependency>
  1. Configure XStream to use the Woodstox XML driver:

XStream xstream = new

XStream(new StaxDriver(new WstxInputFactory(), new WstxOutputFactory()));
  1. Disable external entity resolution in the Woodstox XML driver:

((WstxDriver)

xstream.getDriver()).getConfiguredXMLInputFactory().setProperty(XMLInputFactory.SUPPORT_DTD, false);

((WstxDriver)

xstream.getDriver()).getConfiguredXMLInputFactory().setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);

By following these steps, you can mitigate the XXE vulnerability until a proper upgrade to the latest version of XStream can be performed.

Conclusion

The XML External Entity Injection vulnerability in XStream can have serious security implications, allowing attackers to read sensitive files on the server. It is crucial to upgrade to the latest version of XStream (1.4.9 or later) or apply the provided workaround to mitigate this vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for com.thoughtworks.xstream:xstream →

Share this vulnerability

FAQ

XStream is a Java library used for object serialization and deserialization to XML.

XML External Entity (XXE) injection is a vulnerability that allows an attacker to read arbitrary files on the server by exploiting the XML parsing process.

Versions of XStream before 1.4.9 are affected by this vulnerability.

This vulnerability can lead to unauthorized access to sensitive information stored on the server, such as configuration files or credentials.

To protect your application, it is recommended to upgrade to XStream version 1.4.9 or later, or apply the workaround mentioned in the 'how_to_fix' section.

Related vulnerabilities

Recent vulnerabilities recorded for com.thoughtworks.xstream:xstream.

How To Fix

Latest published version: 1.4.21 as of 22 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.4.9

This is the first release that contains the fix.

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