SiteShadow
Back to vulnerability library

CWE-502 Unsafe Deserialization

What this means

SiteShadow flagged code that deserializes untrusted data using unsafe APIs. This usually means the input can construct complex objects — not just "data" — and those objects can trigger dangerous behavior when loaded.

Why it matters

Unsafe deserialization can lead to code execution.

Safer examples

1) Prefer JSON + strict schema validation

import json

data = json.loads(payload)  # then validate shape/types

2) Avoid native object deserialization for untrusted inputs

Avoid patterns like Java native serialization, Python pickle, Ruby Marshal, .NET BinaryFormatter, etc. for data coming from users, webhooks, or network.

3) If you must deserialize, constrain it hard

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage