Safeguard
Security Guides•

Why do DAST scanners rarely find insecure deserialization?

Insecure deserialization needs format knowledge, a gadget chain and often an out-of-band callback. Why black-box scans miss it and what finds it instead.

Safeguard Security Team
4 min read

Black-box scanners rarely find insecure deserialization because proving it needs the right data format, a usable chain of code in the target's libraries, and often an out-of-band callback. A generic probe cannot guess those. Code and dependency analysis find the risky calls and libraries far more reliably.

What it is

Serialization turns an object into data that can be stored or sent. Deserialization rebuilds the object. The OWASP testing guide says insecure deserialization occurs when an application deserializes untrusted data without sufficiently verifying that it is valid, and that the most critical impact is remote code execution. It can also cause denial of service, authentication bypass and access control issues.

Think of a cookie that holds a serialized user object with an admin flag. If the server trusts it, changing one value changes who you are.

Why generic scanning struggles

The testing guide's own method shows how much knowledge is involved.

  1. Find the entry points. Serialized data may sit in cookies, hidden fields, API bodies, headers or uploaded files.
  2. Recognize the format. Java serialized data begins with the bytes AC ED 00 05, often shown as rO0 once base64 encoded. PHP serialization is readable text with markers for objects and arrays. Python pickle can be opaque binary or base64. .NET output from legacy formatters often begins with a recognizable base64 prefix. Some JSON libraries accept type metadata fields that choose which class to build.
  3. Pick a safe probe. The guide advises an out-of-band or benign crash probe, such as a payload that makes a DNS or HTTP callback to a server the tester controls, and says never to start with a destructive payload.
  4. Match a gadget chain. Many bugs need a sequence of existing code fragments in the app or its dependencies. The tester identifies libraries first, then generates a non-destructive confirmation payload for them.

Each step depends on the previous one. A scanner that does not recognize the format never reaches the probe, and one that cannot receive callbacks cannot confirm the result.

What each approach finds

ApproachStrengthGap
Black-box scanCan spot recognizable serialized values in cookies and parametersRarely confirms exploitation without callbacks and library knowledge
Static code analysisFinds calls that deserialize untrusted inputCannot tell whether a gadget chain exists in a given deployment
Dependency scanningFinds libraries with known deserialization advisoriesDoes not know if your code feeds them untrusted data
Manual testingCan combine all of the aboveSlow, needs expertise

The strongest result comes from combining them: a dependency scan says which libraries are present and affected, code analysis shows whether untrusted data reaches the call, and a targeted manual test confirms.

How to reduce the risk

The OWASP Deserialization Cheat Sheet lists language-agnostic methods, including using alternative data formats and only deserializing signed data. It also describes keeping sensitive fields out of serialization, for example marking them transient in Java. In practice:

  • Prefer plain data formats such as JSON with a fixed schema for anything untrusted.
  • Never deserialize native object formats from users.
  • Sign data you must round trip, and verify before parsing.
  • Keep dependencies patched, since gadget chains often live in libraries.
  • Remove legacy formatters that the vendor has marked obsolete.

Our posts on deserialization risks across Python, Java and .NET and how to review code that deserializes data go further.

Try it yourself

Click through it at your own pace, or open it full screen. See how a code scan points to the exact line where input reaches a risky call.

Quick check

Is JSON safe from deserialization attacks?

Plain JSON parsing into simple data is much safer than native object formats. Risk returns when a library lets the input choose the class to build. See our post is JSON safe from deserialization attacks.

What should I scan to find this class of bug?

Scan dependencies for affected libraries and your code for calls that deserialize untrusted data, then confirm findings by hand.

Safeguard runs dependency scanning with reachability analysis, which helps show whether a vulnerable library is actually called, and offers a free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.