# Unsafe object deserialization

Untrusted bytes reach a format that can instantiate behavior-bearing objects or invoke code, such as Python pickle, without a sufficient trust boundary.

**Candidate CWE:** [CWE-502](https://cwe.mitre.org/data/definitions/502.html)

## Test hypothesis

Trace file/queue/cache/import input to the real loader, including integrity verification before loading. In an isolated synthetic lab, use a benign marker-only object demonstrating an unexpected callable or object type. Compare a valid normal object and a rejected untrusted object through the supported interface.

## Evidence required

Input origin, loader and options, signature/check placement, attacker role, complete reachable consumer path, and harmless observable behavior. For ML/model formats, distinguish plain numeric data from executable serialization features.

## Rule out false positives

Only trusted, integrity-verified inputs are accepted under the documented contract; a safe loader is used; or the claim bypasses the caller validation by invoking the loader directly.

## Playbook and command references

- [Source review: entry point to protected operation](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/source-dataflow.html) — Trace attacker control and authorization through handlers, services, queues, and sensitive operations; promote only reachable violations of a stated invariant.
- [OSS lab: pin, install, prove, reset](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/oss-lab-reproduction.html) — Turn an eligible release into a repeatable synthetic environment with preserved versions, realistic controls, and an explicit reset recipe.

[Find the associated command snippets](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/commands.html?q=Source%20review%3A%20entry%20point%20to%20protected%20operation)

## Referenced by these target playbooks

[OSS & self-hosted](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/oss.html) · [Web & API](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/web-api.html) · [Desktop & extensions](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/desktop.html) · [AI, agents & MCP](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/ai.html) · [Mobile](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/mobile.html)

## Report checklist

- [ ] Capture the affected version, configuration, identities, and object ownership.
- [ ] Preserve a valid baseline and a negative control.
- [ ] Reproduce the forbidden data access, action, or state change on controlled fixtures.
- [ ] Explain the intended security rule and why the observed behavior violates it.
- [ ] State prerequisites, uncertainty, cleanup, and the smallest demonstrated impact.

## Conditional ATT&CK mapping

- [T1190 · Exploit Public-Facing Application](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/attack.html#T1190) — **Only if:** A demonstrated exploit of an Internet-facing service provides initial access to its host, system, or environment; explain the foothold and trust boundary. **Not established by:** Not a blanket label for every web/API weakness. A reflected parameter, scanner alert, or ordinary cross-account object read alone does not establish initial network/system access.
- [T1203 · Exploitation for Client Execution](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/attack.html#T1203) — **Only if:** A client-application vulnerability executes attacker-controlled code when the client processes a file, document, or other content; identify the affected desktop/client process. **Not established by:** A parser crash alone is insufficient. Ordinary web XSS is not automatically a native client execution exploit, and Mobile uses separate technique IDs.

## Primary references

- [Python pickle security warning](https://docs.python.org/3/library/pickle.html)

[Back to the complete vulnerability catalog](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities.html)
