prototype-pollution

Tests JavaScript applications for prototype pollution via __proto__ and constructor.prototype injection paths.

1|Updated Aug 3, 2026
One-click install
npx skills add https://github.com/hanmujun/hanmujun-agent-public --skill prototype-pollution-hanmujun
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prototype-pollution
Source: https://github.com/hanmujun/hanmujun-agent-public/tree/main/skill-library/prototype-pollution
Command: npx skills add https://github.com/hanmujun/hanmujun-agent-public --skill prototype-pollution-hanmujun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? JavaScript applications that deep-merge user input into objects can be polluted through __proto__ or constructor.prototype keys, leading to global state corruption, logic bypass, or RCE. This Skill provides a structured playbook to detect, confirm, and exploit prototype pollution in both client-side and server-side JavaScript stacks during authorized security testing. ## Core Features & Use Cases - Client-Side Probing: URL fragment payloads (#__proto__[key]=value, #constructor[prototype][key]=value) with console verification of polluted Object.prototype properties. - Server-Side Black-Box Detection: A payload-to-signal table for Express/Node apps using qs or body-parser, mapping pollution keys like parameterLimit, json spaces, and status to observable response changes. - Gadget Chains: Exploitation patterns for EJS escapeFunction, Timelion-style expression chains (CVE-2019-7609), and Node child_process option pollution (NODE_OPTIONS, shell, env). - Use Case: During an authorized CTF or pentest, you find an endpoint that JSON-parses the request body and passes it to lodash.merge. Send {"__proto__":{"polluted":true}}, then issue a clean follow-up request to confirm global pollution, and escalate via a template-engine gadget toward RCE. ## Quick Start Test the target's JSON endpoint by sending a proto pollution payload and then a clean request to check whether Object.prototype was globally polluted.

Frequently Asked Questions about prototype-pollution

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test for prototype pollution in a Node.js Express app?▼

Send a JSON body like {"__proto__":{"polluted":true}} to endpoints that deep-parse input, then issue a clean follow-up request and watch for abnormal status codes, JSON spacing, or header changes. Pollution of qs options like parameterLimit or ignoreQueryPrefix is a strong observable signal.

What is the difference between __proto__ and constructor.prototype payloads?▼

__proto__ is treated by many parsers as a magic key attaching properties to the prototype, while constructor.prototype reaches the constructor's prototype object through a normal property path. They are not always equivalent due to filtering and parser differences, so both paths should be tested.

Which libraries are commonly vulnerable to prototype pollution?▼

Deep-merge utilities such as lodash.merge, deep-extend, and hoek applyToDefaults are frequent sinks, along with certain qs and query-string configurations. If the target uses any of these, prototype pollution testing should be prioritized.

Can prototype pollution lead to remote code execution?▼

Yes, when polluted properties are later read as configuration by gadgets. Examples include EJS reading escapeFunction from the prototype, or child_process reading polluted shell, env, or NODE_OPTIONS options, both of which can yield command execution depending on version and configuration.

Why does my prototype pollution payload have no visible effect?▼

The parser may filter __proto__ keys, the merge may be isolated, or the impact may only appear in other workers or later requests. Try the constructor.prototype path, unicode key bypasses, and always confirm with a clean follow-up request since connection pools affect visibility.