Skip to content
OpenAdvisories

Weakness (CWE)

CWE-502: Deserialization of Untrusted Data

Base Draft

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

How to prevent it (7 mitigations)
  1. Architecture and Design, Implementation

    If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.

  2. Implementation

    When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.

  3. Implementation

    Explicitly define a final object() to prevent deserialization.

  4. Architecture and Design, Implementation

    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.

  5. Implementation

    Avoid having unnecessary types or gadgets (a sequence of instances and method invocations that can self-execute during the deserialization process, often found in libraries) available that can be leveraged for malicious ends. This limits the potential for unintended or unauthorized types and gadgets to be leveraged by the attacker. Add only acceptable classes to an allowlist. Note: new gadgets are constantly being discovered, so this alone is not a sufficient mitigation.

  6. Architecture and Design, Implementation

    Employ cryptography of the data or code for protection. However, it's important to note that it would still be client-side security. This is risky because if the client is compromised then the security implemented on the client (the cryptography) can be bypassed.

  7. Operation

    Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].

Source: MITRE CWE-502

3,358 results · Feed

  • High 8.8

    An unsafe deserialization vulnerability exists in the Engine.plugin ProfileInformation ProfileData functionality of COD…

  • High 7.5
    CVE-2021-31010 Exploited

    A deserialization issue was addressed through improved validation. This issue is fixed in Security Update 2021-005 Cata…

    KEV Aug 25, 2022
  • High 8.5

    A Server-Side Forgery Request vulnerability in XStream via PriorityQueue unmarshaling

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to request data from internal resources that are not publicly available only by manipulating the processed input stream…

  • High 8.5
    CVE-2021-39152 Scanner template EPSS 11%

    A Server-Side Forgery Request vulnerability in XStream via HashMap unmarshaling

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to request data from internal resources that are not publicly available only by manipulating the processed input stream…

  • Medium 6.5

    XStream can cause a Denial of Service

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to allocate 100% CPU time on the target system depending on CPU type or parallel execution of such a payload resulting …

  • High 8.5

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. No user is affec…

  • High 8.5

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. No user is affec…

  • High 8.5

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. No user is affec…

  • High 8.5
    CVE-2021-39146 Scanner template EPSS 14%

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. No user is affec…

  • High 8.5

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. No user is affec…

  • High 8.5
    CVE-2021-39141 Public exploit Scanner template EPSS 16%

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. No user is affec…

  • High 8.5

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream, if using the ver…

  • High 8.5

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. No user is affec…

  • High 8.5

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. A user is only a…

  • High 8.5

    XStream is vulnerable to an Arbitrary Code Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker to load and execute arbitrary code from a remote host only by manipulating the processed input stream. No user is affec…

  • High 8.5
    CVE-2021-39144 Exploited Public exploit Scanner template EPSS 98%

    XStream is vulnerable to a Remote Command Execution attack

    XStream is a simple library to serialize objects to XML and back again. In affected versions this vulnerability may allow a remote attacker has sufficient rights to execute commands of the host only by manipulating the processed input stream. No user is affec…

    KEV Mar 10, 2023
  • High 8.8

    An unsafe deserialization vulnerability exists in the ObjectManager.plugin Project.get_MissingTypes() functionality of …

  • High 8.8

    An unsafe deserialization vulnerability exists in the ObjectManager.plugin ObjectStream.ProfileByteArray functionality …

  • Critical 9.3
    CVE-2021-37678 Public exploit

    Arbitrary code execution due to YAML deserialization

    TensorFlow is an end-to-end open source platform for machine learning. In affected versions TensorFlow and Keras can be tricked to perform arbitrary code execution when deserializing a Keras model from YAML format. The [implementation](https://github.com/tens…

  • High 7.7

    Deserialization of Untrusted Data

    This affects the package codeception/codeception from 4.0.0 and before 4.1.22, before 3.1.3. The RunProcess class can be leveraged as a gadget to run arbitrary commands on a system that is deserializing user input without validation.

  • High 8.1

    Deserialization of Untrusted Data in com.supermartijn642.configlib.ConfigSyncPacket

    SuperMartijn642's Config Lib is a library used by a number of mods for the game Minecraft. The versions of SuperMartijn642's Config Lib between 1.0.4 and 1.0.8 are affected by a vulnerability and can be exploited on both servers and clients. Using SuperMartij…

  • High 8.8

    A unsafe deserialization vulnerability exists in the ComponentModel Profile.FromFile() functionality of CODESYS GmbH CO…

  • Critical 9.8
    CVE-2021-34371 Public exploit EPSS 13%

    Deserialization of Untrusted Data in Neo4j

    Neo4j through 3.4.18 (with the shell server enabled) exposes an RMI service that arbitrarily deserializes Java objects, e.g., through setSessionVariable. An attacker can abuse this for remote code execution because there are dependencies with exploitable gadg…

  • High 8.8

    A unsafe deserialization vulnerability exists in the ObjectManager.plugin ProfileInformation.ProfileData functionality …

  • High 8.8

    A unsafe deserialization vulnerability exists in the PackageManagement.plugin ExtensionMethods.Clone() functionality of…

  • High 7.8

    A unsafe deserialization vulnerability exists in the ComponentModel ComponentManager.StartupCultureSettings functionali…

  • Critical 9.8

    Remote code execution via RMI

    Apache jUDDI uses several classes related to Java's Remote Method Invocation (RMI) which (as an extension to UDDI) provides an alternate transport for accessing UDDI services. RMI uses the default Java serialization mechanism to pass parameters in RMI invocat…

  • Critical 9.8

    Deserialization of Untrusted Data Vulnerability Dell EMC Avamar Server versions 7.4.1, 7.5.0, 7.5.1, 18.2, 19.1 and 19.…

  • Critical 9.8
    CVE-2021-35464 Exploited · Ransomware Public exploit Scanner template EPSS 100%

    ForgeRock AM server before 7.0 has a Java deserialization vulnerability in the jato.pageSession parameter on multiple p…

    KEV Nov 3, 2021
  • Unscored —

    A CWE-502: Deserialization of Untrusted Data vulnerability exists that could cause code execution by opening a maliciou…

  • High 7.5

    Untrusted data fed into `Data.init(base32Encoded:)` can result in exposing server memory and/or crash

    Vapor is a web framework for Swift. In versions 4.47.1 and prior, bug in the `Data.init(base32Encoded:)` function opens up the potential for exposing server memory and/or crashing the server (Denial of Service) for applications where untrusted data can end up…

  • Unscored —

    JoomSport < 5.1.8 - Unauthenticated PHP Object Injection

    The joomsport_md_load AJAX action of the JoomSport WordPress plugin before 5.1.8, registered for both unauthenticated and unauthenticated users, unserialised user input from the shattr POST parameter, leading to a PHP Object Injection issue. Even though the p…

  • Critical 9.9

    Remote Code Execution Vulnerability in Session Storage

    Ratpack is a toolkit for creating web applications. In versions prior to 1.9.0, a malicious attacker can achieve Remote Code Execution (RCE) via a maliciously crafted Java deserialization gadget chain leveraged against the Ratpack session store. If one's appl…

  • Critical —

    JFinal Java Deserialization Vulnerability

    In applications using jfinal 4.9.08 and below, there is a deserialization vulnerability when using redis,may be vulnerable to remote code execute

  • High 7.8

    Manuskript through 0.12.0 allows remote attackers to execute arbitrary code via a crafted settings.pickle file in a pro…

  • Critical 9.8

    Java deserialization in Chainsaw

    A deserialization flaw was found in Apache Chainsaw versions prior to 2.1.0 which could lead to malicious code execution.

  • Medium 6.7

    Bridgecrew Checkov: Unsafe deserialization of Terraform files allows code execution

    An unsafe deserialization vulnerability in Bridgecrew Checkov by Prisma Cloud allows arbitrary code execution when processing a malicious terraform file. This issue impacts Checkov 2.0 versions earlier than Checkov 2.0.139. Checkov 1.0 versions are not impact…

  • Unscored —

    VerneMQ MQTT Broker versions prior to 1.12.0 are vulnerable to a denial of service attack as a result of excessive memo…

  • Unscored —

    EMQ X Broker versions prior to 4.2.8 are vulnerable to a denial of service attack as a result of excessive memory consu…

  • Critical 9.0

    Authorized deserialization of untrusted data in McAfee DBSec

    Deserialization of untrusted data vulnerability in McAfee Database Security (DBSec) prior to 4.8.2 allows a remote authenticated attacker to create a reverse shell with administrator privileges on the DBSec server via carefully constructed Java serialized obj…