CWE-502β€”Deserialization of Untrusted Data

PUBLISHEDweakness recordMedium
released 2006-07-19 Β· last modified 2026-04-30
CWE-502 - Deserialization of Untrusted Data - Diagram

Metadata

CWE ID:
CWE-502
Abstraction:
Base
Structure:
Simple
Status:
Draft
Release Date:
2006-07-19
Latest Modification Date:
2026-04-30

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

Related Alerts