CVE-2021-21343 - Deserialization of Untrusted Data

Severity

75%

Complexity

39%

Confidentiality

60%

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 the deletion of a file on the local host. 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.

CVSS 3.1 Base Score 7.5. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

CVSS 2.0 Base Score 5. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:N/C:N/I:P/A:N).

Demo Examples

Deserialization of Untrusted Data

CWE-502

This code snippet deserializes an object from a file and uses it as a UI button:


               
}
in.close();

This code does not attempt to verify the source or contents of the file before deserializing it. An attacker may be able to replace the intended file with a file that contains arbitrary malicious code which will be executed when the button is pressed.

To mitigate this, explicitly define final readObject() to prevent deserialization. An example of this is:


               
throw new java.io.IOException("Cannot be deserialized"); }

Deserialization of Untrusted Data

CWE-502

In Python, the Pickle library handles the serialization and deserialization processes. In this example derived from [R.502.7], the code receives and parses data, and afterwards tries to authenticate a user based on validating a token.


               
}
raise AuthFail

Unfortunately, the code does not verify that the incoming data is legitimate. An attacker can construct a illegitimate, serialized object "AuthToken" that instantiates one of Python's subprocesses to execute arbitrary commands. For instance,the attacker could construct a pickle that leverages Python's subprocess module, which spawns new processes and includes a number of arguments for various uses. Since Pickle allows objects to define the process for how they should be unpickled, the attacker can direct the unpickle process to call Popen in the subprocess module and execute /bin/sh.

Demo Examples

External Control of File Name or Path

CWE-73

The following code uses input from an HTTP request to create a file name. The programmer has not considered the possibility that an attacker could provide a file name such as "../../tomcat/conf/server.xml", which causes the application to delete one of its own configuration files (CWE-22).


               
rFile.delete();

External Control of File Name or Path

CWE-73

The following code uses input from a configuration file to determine which file to open and echo back to the user. If the program runs with privileges and malicious users can change the configuration file, they can use the program to read any file on the system that ends with the extension .txt.


               
out.println(arr);

Overview

First reported 3 years ago

2021-03-23 00:15:00

Last updated 3 years ago

2021-11-30 22:09:00

Affected Software

Debian Linux 9.0

9.0

Oracle Communications Policy Management 12.5.0

12.5.0

Oracle Communications Unified Inventory Management 7.3.2

7.3.2

Oracle Communications Unified Inventory Management 7.3.4

7.3.4

Oracle Communications Unified Inventory Management 7.3.5

7.3.5

Oracle Communications Unified Inventory Management 7.4.0

7.4.0

Oracle WebCenter Portal 11.1.1.9.0

11.1.1.9.0

Oracle WebCenter Portal 12.2.1.3.0

12.2.1.3.0

References

http://x-stream.github.io/changes.html#1.4.16

https://github.com/x-stream/xstream/security/advisories/GHSA-74cv-f58x-f9wf

https://x-stream.github.io/CVE-2021-21343.html

https://x-stream.github.io/security.html#workaround

http://x-stream.github.io/changes.html#1.4.16

Release Notes, Third Party Advisory

https://github.com/x-stream/xstream/security/advisories/GHSA-74cv-f58x-f9wf

Third Party Advisory

https://x-stream.github.io/CVE-2021-21343.html

Exploit, Third Party Advisory

https://x-stream.github.io/security.html#workaround

Mitigation, Third Party Advisory

[debian-lts-announce] 20210403 [SECURITY] [DLA 2616-1] libxstream-java security update

[jmeter-dev] 20210406 [GitHub] [jmeter] sseide opened a new pull request #655: update x-stream to 1.4.16 (from 1.4.15)

[debian-lts-announce] 20210403 [SECURITY] [DLA 2616-1] libxstream-java security update

Mailing List, Third Party Advisory

[jmeter-dev] 20210406 [GitHub] [jmeter] sseide opened a new pull request #655: update x-stream to 1.4.16 (from 1.4.15)

Mailing List, Third Party Advisory

[activemq-users] 20210427 Release date for ActiveMQ v5.16.2 to fix CVEs

Mailing List, Third Party Advisory

https://security.netapp.com/advisory/ntap-20210430-0002/

https://security.netapp.com/advisory/ntap-20210430-0002/

Third Party Advisory

N/A

FEDORA-2021-fbad11014a

FEDORA-2021-d894ca87dc

https://www.oracle.com/security-alerts/cpuoct2021.html

FEDORA-2021-5e376c0ed9

DSA-5004

N/A

Third Party Advisory

FEDORA-2021-fbad11014a

Mailing List, Third Party Advisory

FEDORA-2021-d894ca87dc

Mailing List, Third Party Advisory

https://www.oracle.com/security-alerts/cpuoct2021.html

Third Party Advisory

FEDORA-2021-5e376c0ed9

Mailing List, Third Party Advisory

DSA-5004

Third Party Advisory

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.