logo
Home/CWEs/CWE-502/

CWE-502 - Deserialization of Untrusted Data

  • Abstraction:Base
  • Structure:Simple
  • Status:Draft
  • Release Date:2006-07-19
  • Latest Modification Date:2024-11-19

Weakness Name

Deserialization of Untrusted Data

Description

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

Common Consequences

Scope: Integrity

Impact: Modify Application Data, Unexpected State

Notes: Attackers can modify unexpected objects or data that was assumed to be safe from modification. Deserialized data or code could be modified without using the provided accessor functions, or unexpected functions could be invoked.

Scope: Availability

Impact: DoS: Resource Consumption (CPU)

Notes: If a function is making an assumption on when to terminate, based on a sentry in a string, it could easily never terminate.

Scope: Other

Impact: Varies by Context

Notes: The consequences can vary widely, because it depends on which objects or methods are being deserialized, and how they are used. Making an assumption that the code in the deserialized object is valid is dangerous and can enable exploitation. One example is attackers using gadget chains to perform unauthorized actions, such as generating a shell.

Related Weaknesses

CWE-913Improper Control of Dynamically-Managed Code Resources

CWE-915Improperly Controlled Modification of Dynamically-Determined Object Attributes

Related Alerts

Java Serialization ObjectMedium