Agent skill

Detecting Insecure Deserialization

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Scan a source tree for unsafe-by-default deserialization APIs: Python pickle.loads / cPickle / shelve / dill, Ruby Marshal.load / YAML.load (pre-3.1 default), Java ObjectInputStream.readObject, PHP…

MITAuto-check passedBackend & APIs

Install Detecting Insecure Deserialization

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill detecting-insecure-deserialization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace detecting-insecure-deserialization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/detecting-insecure-deserialization .claude/skills/detecting-insecure-deserialization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
detecting-insecure-deserialization
GitHub stars
2.8k
Token cost
~1.4k tokens
SKILL.md length
404 words
Files
4 (incl. scripts, references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Scan a source tree for unsafe-by-default deserialization APIs: Python pickle.loads / cPickle / shelve / dill, Ruby Marshal.load / YAML.load (pre-3.1 default), Java ObjectInputStream.readObject, PHP…

  • : pre-commit gate on services that accept binary blobs
  • SKILL.md covers Overview, When the skill produces findings, Prerequisites and Instructions, plus 4 more sections
  • Runs Python scripts from its folder; calls python3
  • Audit of legacy job-queue code (workers deserializing tasks)

What it does

Detecting Insecure Deserialization is an agent skill from jeremylongshore/tons-of-skills-marketplace. Scan a source tree for unsafe-by-default deserialization APIs: Python pickle.loads / cPickle / shelve / dill, Ruby Marshal.load / YAML.load (pre-3.1 default), Java ObjectInputStream.readObject, PHP unserialize, .NET BinaryFormatter / NetDataContractSerializer, Node.js node-serialize, JavaScript JSON.parse with reviver containing eval. Use when: pre-commit gate on services that accept binary blobs, audit of legacy job-queue code (workers deserializing tasks), post-bug-report when "we accept user-uploaded…

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts and reference files (for example `references/PLAYBOOK.md`, `references/THEORY.md` and `scripts/scan_deserialization.py`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Background jobs, File uploads and storage and QA and bug reports. It works with Python, Java, .NET and PHP. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • : pre-commit gate on services that accept binary blobs
  • Audit of legacy job-queue code (workers deserializing tasks)
  • Untrusted storage
  • With: scan deserialization

Example prompts

  • “we accept user-uploaded archives.”
  • “scan deserialization”
  • “pickle audit”
  • “/detecting-insecure-deserialization”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Bash(python3:*), Glob, Grep

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash(python3:*)
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Detecting Insecure Deserialization loads about 1.4k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 199 tokens; SKILL.md has 404 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~199
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 404 words, ~1,360 tokens.

Download SKILL.mdSave it as .claude/skills/detecting-insecure-deserialization/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
detecting-insecure-deserialization
description
Scan a source tree for unsafe-by-default deserialization APIs: Python pickle.loads / cPickle / shelve / dill, Ruby Marshal.load / YAML.load (pre-3.1 default), Java ObjectInputStream.readObject, PHP unserialize, .NET BinaryFormatter / NetDataContractSerializer, Node.js node-serialize, JavaScript JSON.parse with reviver containing eval. Use when: pre-commit gate on services that accept binary blobs, audit of legacy job-queue code (workers deserializing tasks), post-bug-report when "we accept user-uploaded archives." Threshold: any call to a known-unsafe deserialization API on data that originates from user input, network, file upload, or untrusted storage. Trigger with: "scan deserialization", "pickle audit", "java readObject scan", "yaml.load check".
allowed-tools
Read, Bash(python3:*), Glob, Grep
compatibility
Designed for Claude Code
disallowed-tools
Bash(rm:*), Bash(curl:*)
version
3.30.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
security, static-analysis, deserialization, pentest

Detecting Insecure Deserialization

Overview

Insecure deserialization (CWE-502, OWASP A08:2021) is the highest- severity injection class in many language stacks because it directly maps to RCE. Pickle, Java serialization, PHP unserialize, and BinaryFormatter all execute object-construction code during deserialization. If that code includes __reduce__ / readObject / __wakeup / OnDeserialization callbacks that the attacker controls, the deserialization step IS code execution.

Most legitimate use cases have safer alternatives (JSON for data, YAML with safe-load, Protocol Buffers, Avro). The remaining cases need explicit type allow-lists and HMAC-signed payloads.

When the skill produces findings

FindingSeverityThresholdAffected control
Python pickle.loads(...)CRITICALalways (untrusted input)CWE-502
Python pickle.load(file)CRITICALalwaysCWE-502
Python dill.loadsCRITICALalwaysCWE-502
Python yaml.load(...) without Loader=CRITICALunsafe legacy defaultCWE-502
Python yaml.unsafe_load(...)CRITICALexplicit unsafeCWE-502
Python shelve.open(...)HIGHpickle-backed; user-controllable filenameCWE-502
Java ObjectInputStream.readObject()CRITICALalwaysCWE-502
PHP unserialize($input)CRITICALnon-literal inputCWE-502
.NET BinaryFormatter.Deserialize(...)CRITICALdeprecated unsafe APICWE-502
.NET NetDataContractSerializerCRITICALalso unsafeCWE-502
.NET LosFormatter.DeserializeCRITICALViewState pathCWE-502
Ruby Marshal.load(...)CRITICALnon-literalCWE-502
Ruby YAML.load(...) (pre-3.1 Psych)CRITICALsafe in Psych 4.0+; needs version checkCWE-502
Node.js node-serialize.unserializeCRITICALknown-vulnerable libCWE-502
Node.js serialize-javascript reviverHIGHif used to deserialize untrustedCWE-502

Prerequisites

  • Python 3.9+
  • Source tree on local filesystem

Instructions

Run
bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/detecting-insecure-deserialization/scripts/scan_deserialization.py /path/to/repo

Options same as previous skills: --output, --format, --min-severity, --include-tests, --languages.

Interpret

CRITICAL across the board because these APIs grant RCE during deserialization if the input is attacker-controlled. The verification step is "can the input ever originate from untrusted source" — if yes, it's an immediate fix.

Show full SKILL.md (153 more words)Show less
Remediation

The fix depends on the data shape:

  • Data is structured (JSON-shaped): switch to json.loads.
  • Data needs polymorphism / arbitrary types: define a strict schema (Pydantic / dataclasses / Protocol Buffers) and validate on parse.
  • Data must round-trip exact Python / Java / .NET objects: use HMAC-signed serialization with an explicit type allow-list.

See references/PLAYBOOK.md for per-language migrations.

Examples

Worker-queue audit
bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/detecting-insecure-deserialization/scripts/scan_deserialization.py \
    /path/to/celery-workers --min-severity high

Celery defaults to pickle in older configurations; this finds the remaining unsafe-default callers.

CI
yaml
- name: Deserialization scan
  run: |
    python3 plugins/security/penetration-tester/skills/detecting-insecure-deserialization/scripts/scan_deserialization.py \
        . --min-severity high

Output

JSON / JSONL / Markdown. Exit codes: 0 / 1 / 2.

Error Handling

Pickle / Marshal usage on a private cache file written by the same application is technically safe (the attacker can't influence the file contents). The scanner flags it as CRITICAL; verify by reading where the input file originates.

Resources

  • references/THEORY.md — Why deserialization is RCE, gadget chains, HMAC-signing pattern, schema-validation alternatives
  • references/PLAYBOOK.md — Per-language migrations (Python pickle → JSON / msgpack, yaml.load → yaml.safe_load, Java ObjectInputStream → JSON via Jackson with allow-list, PHP unserialize → JSON alternatives, .NET BinaryFormatter → System.Text.Json)

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in skills/.curated/detecting-insecure-deserialization of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/PLAYBOOK.md
  • references/THEORY.md
  • scripts/scan_deserialization.py

Open the folder on GitHubat commit cfae287

Compare with similar skills

Detecting Insecure Deserialization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Detecting Insecure Deserialization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Detecting Insecure Deserialization this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.4kAutomated safety check: PassMIT
Assess Migrationmendixlabs/mxcli129—~3.6kAutomated safety check: NotesApache-2.0
Dt Obs ServicesDynatrace/dynatrace-for-ai163—~3.3kAutomated safety check: PassApache-2.0
Hunt DeserializationEncod3d-Sec/TORCH329—~1.7kAutomated safety check: PassMIT
Temporal Developertemporalio/skill-temporal-developer230—~2.5kAutomated safety check: PassMIT
Rds Sqlserveraws/agent-toolkit-for-aws2.8k—~6.3kAutomated safety check: PassApache-2.0

Similar skills

  • Assess Migration

    mendixlabs/mxcli

    Investigate an existing non-Mendix application (Java, .NET, Python, Node, PHP, …) and produce a structured migration assessment for Mendix.

    129 GitHub stars~3.6k tokensUpdated yesterday
    Backend & APIsAuto-check: notes
  • Dt Obs Services

    Dynatrace/dynatrace-for-ai

    Service performance monitoring with RED metrics (Rate, Errors, Duration) and runtime-specific telemetry for Java, .NET, Node.js, Python, PHP, and Go.

    163 GitHub stars~3.3k tokensUpdated 9 days ago
    DevOps & CloudAuto-check passed
  • Hunt Deserialization

    Encod3d-Sec/TORCH

    Insecure deserialization hunting across Java / .NET / PHP / Python / Ruby / Node.

    329 GitHub stars~1.7k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Temporal Developer

    temporalio/skill-temporal-developer

    Official

    Develop, debug, and manage Temporal applications across Python, TypeScript, Go, Java, .NET, Ruby, and Rust.

    230 GitHub stars~2.5k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Rds Sqlserver

    aws/agent-toolkit-for-aws

    Official

    Provides connectivity, authentication, and troubleshooting guidance for Amazon RDS for SQL Server.

    2.8k GitHub stars~6.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Tsh Implementing Backend

    TheSoftwareHouse/copilot-collections

    Backend service implementation patterns, standards, and procedures.

    284 GitHub stars~5.8k tokensUpdated 5 days ago
    Backend & APIsAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated yesterday
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed

Questions about Detecting Insecure Deserialization

What does Detecting Insecure Deserialization do?

Scan a source tree for unsafe-by-default deserialization APIs: Python pickle.loads / cPickle / shelve / dill, Ruby Marshal.load / YAML.load (pre-3.1 default), Java ObjectInputStream.readObject, PHP…. Detecting Insecure Deserialization is an agent skill from jeremylongshore/tons-of-skills-marketplace.parse with reviver containing eval.

When should I use Detecting Insecure Deserialization?

Detecting Insecure Deserialization fits situations like: : pre-commit gate on services that accept binary blobs; audit of legacy job-queue code (workers deserializing tasks); untrusted storage; with: scan deserialization.

How do I install Detecting Insecure Deserialization in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill detecting-insecure-deserialization -a claude-code`. Or copy the skill folder (skills/.curated/detecting-insecure-deserialization in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/detecting-insecure-deserialization in your project. Claude Code loads it when a task matches its description.

How do I install Detecting Insecure Deserialization in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill detecting-insecure-deserialization -a codex`. Or copy the skill folder (skills/.curated/detecting-insecure-deserialization in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/detecting-insecure-deserialization in your project. Codex loads it when a task matches its description.

Can I use Detecting Insecure Deserialization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill detecting-insecure-deserialization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/detecting-insecure-deserialization, .gemini/skills/detecting-insecure-deserialization, .github/skills/detecting-insecure-deserialization and .opencode/skills/detecting-insecure-deserialization in your project.

What does Detecting Insecure Deserialization need to run?

Going by SKILL.md and its folder, Detecting Insecure Deserialization needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3; Node.js. Its frontmatter pre-approves these tools: Read, Bash(python3:*), Glob, Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Detecting Insecure Deserialization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Detecting Insecure Deserialization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Detecting Insecure Deserialization use?

Detecting Insecure Deserialization is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Detecting Insecure Deserialization use?

About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.9k tokens, read only when the agent opens those files.

What are the alternatives to Detecting Insecure Deserialization?

Skills that share tags, products or a category with Detecting Insecure Deserialization: Assess Migration (mendixlabs/mxcli, 129 stars), Dt Obs Services (Dynatrace/dynatrace-for-ai, 163 stars), Hunt Deserialization (Encod3d-Sec/TORCH, 329 stars) and Temporal Developer (temporalio/skill-temporal-developer, 230 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Detecting Insecure Deserialization?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.