CVE-2021-21345 XStream is vulnerable to a Remote Command Execution attack

Medium 5.8 Published Updated

Remote attackers can execute arbitrary host commands via manipulated input streams if XStream's security framework whitelist is not configured.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-21345?

CVE-2021-21345 is a medium-severity unsafe deserialization vulnerability in Apache Activemq, published on 22 Mar 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official 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 who has sufficient rights to execute commands of the host 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.

Weakness: CWE-78, CWE-94, CWE-502

Which versions are affected by CVE-2021-21345?

3 open source packages ship an affected version, including activemq and com.thoughtworks.xstream:xstream. It affects 16 products.

PackageAffectedFixed in
activemq BitnamiAll versions to 5.16.05.15.14
com.thoughtworks.xstream:xstream MavenAll versions1.4.16
com.thoughtworks.xstream:xstream MavenAll versions1.4.16

Products include Apache Activemq, Apache Jmeter, Debian Debian Linux, Fedoraproject Fedora, Netapp Oncommand Insight, Oracle Banking Enterprise Default Management and 10 more.

How do I fix CVE-2021-21345?

Upgrade activemq to 5.15.14 or later.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2021-21345 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-21345 exists.

Public exploit code: 1 Nuclei template and 1 proofs of concept on GitHub.

All Apache Activemq vulnerabilities

Sources

Also known as BIT-activemq-2021-21345, DEBIAN-CVE-2021-21345, GHSA-hwpc-8xqv-jvj4, UBUNTU-CVE-2021-21345.

Is CVE-2021-21345 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free