prototype-pollution
यह क्या करती है
यह स्किल prototype pollution का वर्णन करती है, JavaScript और Node.js की एक कमज़ोरी जहाँ गढ़ी हुई कुंजी आधार ऑब्जेक्ट बदल देती है, जिसे हर ऑब्जेक्ट विरासत में पाता है। यह उन डेवलपर्स और समीक्षकों के लिए है जो अधिकृत कोड की जाँच करते हैं।
कब इस्तेमाल करें
- ✓जब डेवलपर पूछता है कि क्या Node.js ऐप अविश्वसनीय JSON या क्वेरी डेटा ऑब्जेक्ट में मर्ज करता है।
- ✓जब एजेंट प्रोजेक्ट की डिपेंडेंसी में मर्ज या क्लोन लाइब्रेरी की जाँच करता है जिनके संस्करण ज्ञात रूप से जोखिम भरे हैं।
- ✓जब टीम पक्का करना चाहती है कि खोज में असली असर दिखता है, केवल बदला हुआ ऑब्जेक्ट नहीं।
Skill का लिंक
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/prototype-pollution/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप हमारे Node.js ऐप की जाँच कर सकते हैं कि यूज़र का JSON हर दूसरे ऑब्जेक्ट के लिए इस्तेमाल होने वाले आधार ऑब्जेक्ट को बदल सकता है या नहीं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट deep merge और clone कॉल खोजता है, उनमें अविश्वसनीय इनपुट का रास्ता देखता है, और डिपेंडेंसी के संस्करण ज्ञात जोखिम भरे संस्करणों से मिलाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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.
अक्सर पूछे जाने वाले सवाल
prototype pollution क्या है?
जब गढ़ी हुई कुंजी किसी आधार ऑब्जेक्ट में प्रॉपर्टी जोड़ दे, ताकि बदलाव कई दूसरे ऑब्जेक्ट में दिखे।
कौन-से इनपुट जोखिम भरे हैं?
स्किल JSON बॉडी, क्वेरी स्ट्रिंग, YAML अपलोड और फ़ॉर्म डेटा को आम स्रोत बताती है।
कौन-सी लाइब्रेरी का ज़िक्र है?
स्किल कई deep merge और clone लाइब्रेरी सूचीबद्ध करती है, और कहती है कि एजेंट इंस्टॉल किए गए संस्करण जाँचे।
जानकारी
लेखक का मूल विवरण
Hunt JavaScript prototype pollution (CWE-1321) — the 2023-2026 meta-vulnerability that chains into RCE, auth bypass, and SSRF on most Node.js stacks.
लोकप्रियता
- GitHub स्टार
- 6.5k
- रैंकिंग में स्थान
- #13967
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
detector-overview
6.5kयह आपके एजेंट को स्कैनर से चिह्नित कोड पढ़ने और तय करने में मदद करती है कि कौन सी जगहें असली सुरक्षा बग हैं और कौन सी गलत चेतावनी।
exploiter-overview
6.5kयह आपके एजेंट को कई पक्की सुरक्षा कमज़ोरियों को एक परीक्षण श्रृंखला में जोड़ने और जाँचने में मदद करती है कि वह श्रृंखला कितनी दूर तक पहुँच सकती है।
llm-redteam-overview
6.5kयह आपके एजेंट को परीक्षण के लिए सही AI रेड-टीम गाइड खोजने में मदद करती है, प्रॉम्प्ट इंजेक्शन से लेकर मॉडल के दुरुपयोग तक 15 रणनीति समूहों में।
aatmf-t01-prompt-injection
6.5kसमझाती है कि प्रॉम्प्ट इंजेक्शन क्या है, जिसमें छिपे निर्देश AI सिस्टम के नियम बदलने की कोशिश करते हैं, ताकि सुरक्षा परीक्षक उसकी जाँच कर सकें।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।