CVE Vulnerabilities

CVE-2020-9484

Deserialization of Untrusted Data

Published: May 20, 2020 | Modified: Nov 07, 2023
CVSS 3.x
7
HIGH
Source:
NVD
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
4.4 MEDIUM
AV:L/AC:M/Au:N/C:P/I:P/A:P
RedHat/V2
RedHat/V3
Ubuntu

When using Apache Tomcat versions 10.0.0-M1 to 10.0.0-M4, 9.0.0.M1 to 9.0.34, 8.5.0 to 8.5.54 and 7.0.0 to 7.0.103 if a) an attacker is able to control the contents and name of a file on the server; and b) the server is configured to use the PersistenceManager with a FileStore; and c) the PersistenceManager is configured with sessionAttributeValueClassNameFilter=null (the default unless a SecurityManager is used) or a sufficiently lax filter to allow the attacker provided object to be deserialized; and d) the attacker knows the relative file path from the storage location used by FileStore to the file the attacker has control over; then, using a specifically crafted request, the attacker will be able to trigger remote code execution via deserialization of the file under their control. Note that all of conditions a) to d) must be true for the attack to succeed.

Weakness

The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.

Affected Software

Name Vendor Start Version End Version
Tomcat Apache 7.0.0 (including) 7.0.108 (excluding)
Tomcat Apache 8.5.0 (including) 8.5.63 (excluding)
Tomcat Apache 9.0.1 (including) 9.0.43 (excluding)
Tomcat Apache 9.0.0-milestone1 (including) 9.0.0-milestone1 (including)
Tomcat Apache 9.0.0-milestone10 (including) 9.0.0-milestone10 (including)
Tomcat Apache 9.0.0-milestone11 (including) 9.0.0-milestone11 (including)
Tomcat Apache 9.0.0-milestone12 (including) 9.0.0-milestone12 (including)
Tomcat Apache 9.0.0-milestone13 (including) 9.0.0-milestone13 (including)
Tomcat Apache 9.0.0-milestone14 (including) 9.0.0-milestone14 (including)
Tomcat Apache 9.0.0-milestone15 (including) 9.0.0-milestone15 (including)
Tomcat Apache 9.0.0-milestone16 (including) 9.0.0-milestone16 (including)
Tomcat Apache 9.0.0-milestone17 (including) 9.0.0-milestone17 (including)
Tomcat Apache 9.0.0-milestone18 (including) 9.0.0-milestone18 (including)
Tomcat Apache 9.0.0-milestone19 (including) 9.0.0-milestone19 (including)
Tomcat Apache 9.0.0-milestone2 (including) 9.0.0-milestone2 (including)
Tomcat Apache 9.0.0-milestone20 (including) 9.0.0-milestone20 (including)
Tomcat Apache 9.0.0-milestone21 (including) 9.0.0-milestone21 (including)
Tomcat Apache 9.0.0-milestone22 (including) 9.0.0-milestone22 (including)
Tomcat Apache 9.0.0-milestone23 (including) 9.0.0-milestone23 (including)
Tomcat Apache 9.0.0-milestone24 (including) 9.0.0-milestone24 (including)
Tomcat Apache 9.0.0-milestone25 (including) 9.0.0-milestone25 (including)
Tomcat Apache 9.0.0-milestone26 (including) 9.0.0-milestone26 (including)
Tomcat Apache 9.0.0-milestone27 (including) 9.0.0-milestone27 (including)
Tomcat Apache 9.0.0-milestone3 (including) 9.0.0-milestone3 (including)
Tomcat Apache 9.0.0-milestone4 (including) 9.0.0-milestone4 (including)
Tomcat Apache 9.0.0-milestone5 (including) 9.0.0-milestone5 (including)
Tomcat Apache 9.0.0-milestone6 (including) 9.0.0-milestone6 (including)
Tomcat Apache 9.0.0-milestone7 (including) 9.0.0-milestone7 (including)
Tomcat Apache 9.0.0-milestone8 (including) 9.0.0-milestone8 (including)
Tomcat Apache 9.0.0-milestone9 (including) 9.0.0-milestone9 (including)
Tomcat Apache 10.0.0-milestone1 (including) 10.0.0-milestone1 (including)
Tomcat Apache 10.0.0-milestone2 (including) 10.0.0-milestone2 (including)
Tomcat Apache 10.0.0-milestone3 (including) 10.0.0-milestone3 (including)
Tomcat Apache 10.0.0-milestone4 (including) 10.0.0-milestone4 (including)

Extended Description

It is often convenient to serialize objects for communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions if it does not use cryptography to protect itself. Furthermore, any cryptography would still be client-side security – which is a dangerous security assumption. Data that is untrusted can not be trusted to be well-formed. When developers place no restrictions on “gadget chains,” or series of instances and method invocations that can self-execute during the deserialization process (i.e., before the object is returned to the caller), it is sometimes possible for attackers to leverage them to perform unauthorized actions, like generating a shell.

Potential Mitigations

  • Make fields transient to protect them from deserialization.
  • An attempt to serialize and then deserialize a class containing transient fields will result in NULLs where the transient data should be. This is an excellent way to prevent time, environment-based, or sensitive variables from being carried over and used improperly.

References