web-deserialization

web-deserialization is a skill for Claude Code, Codex from s0ld13rr/pentestcode. It costs 98 tokens per session (718 once invoked), scanned A, original, MIT.

A security-testing guide for insecure deserialization, a flaw where an application turns attacker-controlled data back into objects without checking it safely. In some web applications, this can lead to running code on the server.

In plain words
What is it for?
Use it during authorized testing of Java, PHP, .NET, Python, or Node web applications that process serialized data.
Why use it?
It helps identify unsafe handling of serialized cookies, tokens, uploads, or request data and determine whether the flaw has serious impact.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it during authorized testing of Java, PHP, .NET, Python, or Node web applications that process serialized data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s0ld13rr/pentestcode/deserialization
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add s0ld13rr/pentestcode --skill deserialization
Clone the repo
git clone --depth 1 https://github.com/s0ld13rr/pentestcode

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for web-deserialization

README.md
[![agentmods](https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/deserialization/github.svg)](https://agentmods.dev/skills/s0ld13rr/pentestcode/deserialization)
Your own site
<a href="https://agentmods.dev/skills/s0ld13rr/pentestcode/deserialization"><img src="https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/deserialization/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for web-deserialization

Your own site · 80×15
<a href="https://agentmods.dev/skills/s0ld13rr/pentestcode/deserialization"><img src="https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/deserialization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 718 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00098 $0.00718
Opus 5.5 $0.00039 $0.00287
Sonnet 5.5 $0.00020 $0.00144
Haiku 4.5 $0.00010 $0.00072

Measured 1mo ago against content hash b6bf5f825c0e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

web-deserialization scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

# Python — pickle __reduce__ → os.system('id') ; Node — node-serialize _$$ND_FUNC$$_ IIFE
skills/web/deserialization/SKILL.md · 38 lines

How it starts

The opening of the file, as written. The whole thing — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Insecure Deserialization → RCE

When this fires

Attacker-controlled data is deserialized: cookies/tokens/hidden fields that decode to a serialized object, __VIEWSTATE, RMI/HTTP-invoker/message-queue bodies, or a known deser-CVE stack (see web-framework-rce for the CVE map).

Decide — fingerprint the format FIRST

  • base64 rO0AB... or raw hex AC ED 00 05 → Java (ObjectInputStream).
  • O:8:"ClassName":... → PHP (unserialize()).
  • __VIEWSTATE / AAEAAAD... → .NET (BinaryFormatter/LosFormatter).
  • python pickle opcodes (\x80\x04, c__builtin__) → Python.
  • {"rce":"_$$ND_FUNC$$_..."} → Node (node-serialize).

Exploit → PROVE IMPACT (gadget chains)

# Java — ysoserial (pick a gadget matching the classpath: CommonsCollections1-7, URLDNS to test reachability first):
java -jar ysoserial.jar CommonsCollections6 'id' | base64 -w0        # place in the sink
#   iterate gadgets: URLDNS/JRMPClient to confirm deser happens, then CC/Spring/Hibernate for RCE
# PHP — phpggc (find the framework's gadget: Laravel/Symfony/Monolog/Guzzle):
phpggc Monolog/RCE1 system id
# .NET — ysoserial.net -g TypeConfuseDelegate -f BinaryFormatter -c "cmd /c ..."
# Python — pickle __reduce__ → os.system('id')  ;  Node — node-serialize _$$ND_FUNC$$_ IIFE

Proof required: id/uname (RCE). If the classpath is unknown, confirm deserialization first with a benign OOB gadget (Java URLDNS → your listener), then find the working RCE gadget; log each attempted gadget via record_vector attempt: so you don't re-try dead chains.

Tooling

ysoserial (Java), phpggc (PHP), ysoserial.net (.NET), gadgetinspector for custom classpaths; nuclei -tags deserialization.

False positives / pitfalls

  • Signed/encrypted blobs (HMAC'd cookies, encrypted VIEWSTATE) → you need the key first (leaked/weak/default) — see web-auth-bypass-idor for key recovery; don't brute blindly.
  • Gadget must match the LIBRARIES on the classpath — a failed CC1 doesn't mean not-vulnerable; iterate the gadget set.
  • Length/type validation before deser → may need to satisfy a wrapper.

Read the full file on GitHub · 38 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 38 lines · 98 tokens per session scan A b6bf5f825c0e

Subscribe to this mod's changes

web-deserialization is a skill published in the GitHub repository s0ld13rr/pentestcode (851 stars, last pushed 15d ago), licensed MIT. It adds 98 tokens to every session and 718 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.