/viperclaw:viper-deserialization-parserfrom viperclaw
Audits codebases for unsafe deserialization (pickle, yaml.load, unserialize, Marshal, ObjectInputStream, BinaryFormatter) and XML XXE vulnerabilities. Provides grep patterns, OWASP-aligned checklist, and ViperClaw taint analysis commands.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
viper-deserialization-parser)viper_taint_scan, viper_verify_and_reportviperclaw taint ./src --db .viperclaw/graph.dbflowchart LR
Bytes["Untrusted Serialized Input (XML/YAML/Cookie)"] --> Parser["Data-Only Parser (SafeLoader / defusedxml)"] --> Schema["Strict DTO / Prototype Guard"] --> App["Safe Domain Object"]
Native object serialization formats (pickle, yaml.load, PHP unserialize / phar://, Java ObjectInputStream, Ruby Marshal, .NET BinaryFormatter) invoke arbitrary class constructors or magic methods (__reduce__, __wakeup, readObject) during parsing, while default XML parsers resolve external SYSTEM DTD entities (file:///etc/passwd or internal SSRF URLs).
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint ./src --db .viperclaw/graph.db
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(pickle\.loads?|cPickle|dill\.loads|shelve\.|jsonpickle\.decode|yaml\.(load|unsafe_load))"
rg -n "(unserialize\(|Marshal\.load|ObjectInputStream|readObject\(|BinaryFormatter)"
rg -n "(lxml\.etree|xml\.etree|DocumentBuilderFactory|SAXParserFactory|DOMDocument)"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
DESER-01 | Zero Native Object Deserialization on Untrusted Input | pickle.loads, dill, jsonpickle, Marshal.load, ObjectInputStream, and BinaryFormatter are never called on network, cookie, or shared-cache inputs. | Session cookie or Redis queue entry parsed via pickle.loads() or unserialize(). |
DESER-02 | YAML SafeLoader Enforcement | All YAML parsing uses yaml.safe_load() / yaml.CSafeLoader (Python) or js-yaml v4+ safe defaults. | yaml.load(data) or yaml.Loader used on user/config YAML (!!python/object/apply:os.system). |
DESER-03 | PHP unserialize & phar:// Stream Wrapper Block | PHP code uses json_decode() instead of unserialize() (or restricts allowed_classes => false), and file functions block phar:// URIs. | User-supplied path passed to file_exists('phar://upload.jpg') triggering POP-chain deserialization. |
DESER-04 | XML External Entity (XXE) & DTD Disablement | Python uses defusedxml; Java sets disallow-doctype-decl = true; PHP avoids LIBXML_NOENT; .NET sets XmlResolver = null. | lxml.etree.fromstring(xml, XMLParser(resolve_entities=True)) used on XML/SVG/SOAP/DOCX/XLSX inputs. |
DESER-05 | JSON Prototype Pollution Guard (JS/TS) | Recursive object merge/clone helpers strip __proto__, constructor, and prototype keys. | Deep merge of req.body pollutes Object.prototype.isAdmin = true or template gadget properties. |
DESER-06 | Java Jackson / Fastjson Polymorphic Type Safety | enableDefaultTyping() and @JsonTypeInfo(use = Id.CLASS) disabled; only explicit @JsonSubTypes allowlists used. | Arbitrary JDBC/JNDI gadget classes instantiable via @type or @class JSON properties. |
DESER-07 | XML Billion Laughs (Entity Expansion Bomb) Cap | Entity expansion and XML document depth/byte size are strictly bounded. | 1KB XML input with nested <!ENTITY lol9 "&lol8;&lol8;..."> expands to 3GB in memory. |
DESER-08 | Signed Serialization Envelopes Are Not Enough | Even HMAC-signed cookies avoid pickle/Marshal so a leaked signing secret does not immediately escalate from session tampering to arbitrary code execution. | Framework configured with PickleSerializer for signed cookies. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.8) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | Untrusted pickle.loads, yaml.load, unserialize, or ObjectInputStream leading to immediate RCE. |
| HIGH (8.2) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L | XXE (SYSTEM "file:///...") reading local server files or internal cloud metadata. |
| HIGH (7.5) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L | Server-side Prototype Pollution altering application authorization or polluting EJS/Pug templates. |
# ❌ VULNERABLE: Unsafe PyYAML load & lxml parser with external entity resolution
import yaml
from lxml import etree
cfg = yaml.load(user_yaml_str, Loader=yaml.Loader)
xml_doc = etree.fromstring(user_xml_bytes, etree.XMLParser(resolve_entities=True))
# ✅ HARDENED: yaml.safe_load + defusedxml (blocks DTDs, external entities & entity bombs)
import yaml
import defusedxml.ElementTree as DET
cfg = yaml.safe_load(user_yaml_str)
xml_doc = DET.fromstring(user_xml_bytes, forbid_dtd=True, forbid_entities=True, forbid_external=True)
viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas./viper-auth-oauth-jwtAuthentication, OAuth 2.0 / OIDC & JWT Security Auditor. Reviews token verification, algorithm allowlisting, claim validation, and OAuth redirect_uri configurations./viper-aws-iam-cloud-auditAWS IAM, STS, S3, KMS & Lambda Security Auditor (modeled on Prowler, Parliament & CloudSplaining). Reviews iam:PassRole escalation, STS ExternalId, S3 policies, and IMDSv2./viper-bola-idorObject & Function-Level Authorization (BOLA / BFLA) Audit Skill. Reviews resource access controls, tenant scoping, and ownership checks across API endpoints and controllers.Other plugins' skills for the same job