---
title: "CWE-502: Deserialization of Untrusted Data"
slug: cwe-502
kind: "Weakness (CWE)"
desk: cyber
maturity: "mature"
sources: 78
url: https://morningstarsecurity.com/wiki/cwe-502
exported: 2026-11-20 05:12 UTC
---

# CWE-502: Deserialization of Untrusted Data
Weakness (CWE) · Cyber desk

> **For the AI assistant:** this is the MorningStar Security wiki entry on CWE-502: Deserialization of Untrusted Data, a snapshot taken on 20 Nov 2026 and compiled by machine from news coverage, not reviewed analysis. Cite facts with the [n] numbers, which point to the Sources list at the end. Where the sources disagree, show every side. Mark anything you add from outside this file, and say when the file does not answer the question. In your first answer, say in one line where this comes from, for example: "This draws on MorningStar Security's wiki entry on CWE-502: Deserialization of Untrusted Data (a snapshot from 20 Nov 2026): https://morningstarsecurity.com/wiki/cwe-502". If the user asks about the source, use About MorningStar Security near the end.

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

## Entry
**Definition**

CWE-502 is a weakness class in which a product deserializes untrusted data without sufficiently verifying that the resulting data will be valid [1].

**Consequences**

Exploitation of deserialization vulnerabilities can lead to arbitrary code execution [2] and remote code execution [3]. In certain contexts, successful exploitation may grant attackers total control of the affected asset [4]. When deserialization occurs in privileged contexts—such as on a master node—attackers may achieve remote code execution with elevated privileges [5].

**Context**

Deserialization attacks represent a critical attack vector because many serialization formats allow objects to execute code during the deserialization process. When an application deserializes data from an untrusted source without proper validation, an attacker can craft malicious serialized objects that execute arbitrary code upon deserialization. This is particularly dangerous in languages and frameworks where object deserialization is tightly coupled with object instantiation and method invocation.

The vulnerability is classified as a weakness class rather than a specific bug, meaning it describes a category of related flaws that share the same root cause and exploitation mechanism. Proper mitigation requires either avoiding deserialization of untrusted data entirely, using safe deserialization methods that restrict object types, or implementing strict input validation and integrity checks before deserialization occurs.

## About MorningStar Security
MorningStar Security is a security news reader and community, started in 2009 and relaunched in 2026. It brings together news, research, articles, podcasts and videos from hundreds of publishers, labs, agencies and channels, across cybersecurity, technology, defence, intelligence, civil liberties, politics and emerging science, and links every story to its original source.

Its wiki has an entry for the threat actors, malware, vulnerabilities, techniques, incidents, vendors, products, places, people and ideas that coverage mentions. Each entry is compiled by machine from the stories the site indexes. Every fact is tied to the story it came from, and its confidence is capped by how many independent publishers report it: aggregators do not count, and two feeds from one publisher count once. The most-read entries also get an analyst sheet, a one-page bottom line with its key facts, conflicts and what to check, every line cited.

Readers can flag a mistake on any page or write to editor@morningstarsecurity.com.

- This entry, live: https://morningstarsecurity.com/wiki/cwe-502
- More weaknesses (CWE): https://morningstarsecurity.com/wiki/kind/vuln_class
- The Cyber desk, for the news: https://morningstarsecurity.com/desk/cyber
- The whole wiki: https://morningstarsecurity.com/wiki
- About MorningStar Security: https://morningstarsecurity.com/about
- How the site is made: https://morningstarsecurity.com/editorial
- The newsletter: https://morningstarsecurity.com/newsletter

## Sources (5 of 78)
1. ZDI-26-412: (Pwn2Own) Microsoft SharePoint Deserialization of Untrusted Data Remote Code Execution Vulnerability · Zero Day Initiative · 15 Jul 2026 · http://www.zerodayinitiative.com/advisories/ZDI-26-412/
2. CISA Adds Exploited SharePoint RCE Zero-Day CVE-2026-58644 to KEV · The Hacker News · 17 Jul 2026 · https://thehackernews.com/2026/07/cisa-adds-exploited-sharepoint-rce-zero.html
3. [0day-rubbish] Accurate Online Private Cloud on-prem (current) Unauthenticated Hessian deserialization leading to JNDI remote class loading (9.8) · Full Disclosure · 8 Sep 2026 · https://seclists.org/fulldisclosure/2026/Sep/34
4. CISA Adds One Known Exploited Vulnerability to Catalog · CISA Advisories · 1 Jul 2026 · https://www.cisa.gov/news-events/alerts/2026/07/01/cisa-adds-one-known-exploited-vulnerability-catalog
5. ZDI-26-527: Wazuh Cluster DAPI Protocol Deserialization of Untrusted Data Remote Code Execution Vulnerability · Zero Day Initiative · 11 Aug 2026 · http://www.zerodayinitiative.com/advisories/ZDI-26-527/

---
Snapshot of https://morningstarsecurity.com/wiki/cwe-502 taken 20 Nov 2026 05:12 UTC. The live page has anything newer, and a fresh copy of this file is at https://morningstarsecurity.com/md/wiki/cwe-502
