Skip to main content

CWE-502: CWE-502: Deserialization of Untrusted Data

BaseStable🏆 #19 in Top 25 (2024)

Description

View on MITRE
237Related CVEs
10.29Severity Score
Back to CWE Lookup

Technical Details

Structure
Simple
Vulnerability Mapping
ALLOWED

Applicable To

Languages
Languages
Platforms
Languages

🏆 CWE Top 25 Historical Ranking

2023:#15
Score: 5.56
219 CVEs
2024:#19↓4
Score: 10.29
237 CVEs
Trend:Improving (moved up 4 ranks)

Frequently Asked Questions

What is CWE-502: CWE-502: Deserialization of Untrusted Data?+

CWE-502: CWE-502: Deserialization of Untrusted Data is a Common Weakness Enumeration (CWE) entry maintained by MITRE. Description

Is CWE-502 in the CWE Top 25 Most Dangerous Software Weaknesses?+

Yes. CWE-502 ranked #19 in the CWE Top 25 for 2024, associated with 237 CVEs that year. The CWE Top 25 highlights the most common and impactful software weaknesses based on real-world vulnerability data.

What are the security consequences of CWE-502: Deserialization of Untrusted Data?+

If exploited, CWE-502 (CWE-502: Deserialization of Untrusted Data) it can compromise Modify Application Data, Unexpected State, DoS: Resource Consumption (CPU) and Varies by Context, leading to outcomes such as Scope: Integrity 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 If a function is making an assumption on when to terminate, based on a sentry in a string, it could easily never terminate. and Scope: Other The consequences can vary widely.

How do you prevent or mitigate CWE-502: Deserialization of Untrusted Data?+

Recommended mitigations for CWE-502 include: 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. 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. Explicitly define a final object() to prevent deserialization.

Which programming languages are affected by CWE-502: Deserialization of Untrusted Data?+

CWE-502 commonly affects Languages. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-502 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More