advisory-mining
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or…
Detect method clobbering via user-controlled object keys that overwrite built-in methods like toString, valueOf, or hasOwnProperty, causing crashes or logic bypass.
Claude Code
$ npx -y skills add ByamB4/find-cve-agent --skill method-clobbering --agent claude-code
Codex
$ npx skills add ByamB4/find-cve-agent --skill method-clobbering -a codex -y
Cursor
$ npx skills add ByamB4/find-cve-agent --skill method-clobbering -a cursor -y
Gemini CLI
$ npx skills add ByamB4/find-cve-agent --skill method-clobbering -a gemini-cli -y
GitHub Copilot
$ npx skills add ByamB4/find-cve-agent --skill method-clobbering -a github-copilot -y
OpenCode
$ npx skills add ByamB4/find-cve-agent --skill method-clobbering -a opencode -y
Windsurf
$ npx skills add ByamB4/find-cve-agent --skill method-clobbering -a windsurf -y
name: method-clobbering
description: "Detect method clobbering via user-controlled object keys that overwrite built-in methods like toString, valueOf, or hasOwnProperty, causing crashes or logic bypass."
metadata:
filePattern:
- "**/*.js"
- "**/*.ts"
bashPattern:
- "grep.*(toString|valueOf|hasOwnProperty|constructor)"
priority: 75Audit CSV/form/query string parsers that create plain objects from untrusted input where the attacker can control property names (keys), not just values.
When a parser creates a plain object `{}` from user input, the attacker can set keys like `toString`, `valueOf`, `hasOwnProperty` to non-function values. Any code that later calls these methods on the object will throw a TypeError.
**Important**: JSON.parse can do the same thing. You MUST show why the library-specific clobbering is worse than what JSON.parse enables. Show a REAL crash path, not just theoretical property overwrite.
| Key | Normal Type | Effect When Clobbered | |-----|------------|----------------------| | `toString` | Function | `obj + ""` throws TypeError | | `valueOf` | Function | `obj == x` or coercion throws TypeError | | `hasOwnProperty` | Function | `obj.hasOwnProperty(k)` throws TypeError | | `constructor` | Function | Type checks fail | | `__proto__` | Object | Prototype pollution (see prototype-pollution skill) | | `__defineGetter__` | Function | Legacy getter/setter manipulation | | `__defineSetter__` | Function | Legacy getter/setter manipulation | | `__lookupGetter__` | Function | Legacy getter/setter introspection | | `toJSON` | undefined | `JSON.stringify(obj)` throws TypeError | | `then` | undefined | `await obj` or Promise.resolve(obj) treats obj as thenable |
grep -rn "\[key\]\s*=" . --include="*.js" --include="*.ts" grep -rn "\[header\]\|\[field\]\|\[name\]\|\[prop\]" . grep -rn "result\[\|output\[\|obj\[\|data\[\|parsed\[" .
Common sources of attacker-controlled keys:
grep -rn "Object\.create(null)" . # Null prototype = safe grep -rn "hasOwnProperty\|toString\|valueOf" . | grep -i "filter\|block\|skip" grep -rn "Object\.keys\|Map\|new Map" .
You MUST show one of: 1. **TypeError crash**: Code calls `obj.toString()` or `obj.hasOwnProperty()` on the parsed result 2. **Logic bypass**: Code checks `obj.hasOwnProperty(x)` for security decisions 3. **Thenable confusion**: Code uses `await` or Promise.resolve() on the parsed object
# Find code that calls methods on parsed objects
grep -rn "\.toString()\|\.valueOf()\|\.hasOwnProperty(" .
grep -rn "JSON\.stringify(" . # Uses toJSON
grep -rn "await\|Promise\.resolve" . # Uses then1. Can JSON.parse achieve the same clobbering? If yes, why is this worse? 2. Does code actually call methods on the parsed object? 3. Is the crash catchable (try/catch around it)? 4. Is the parser documented as expecting trusted input?
Open Source CVE Hunting Harness for Claude Code A Claude Code plugin that systematically finds real CVEs in open source packages through coordinated multi-agent security research.
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or…
Detect authentication and authorization bypass vulnerabilities including missing auth middleware, JWT algorithm confusion, IDOR,…
Detect code injection vulnerabilities in packages that dynamically generate or evaluate code via new Function(), eval(), vm.run*,…
Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper…
Cross-pollination multiplier technique: find a vulnerability in one package, then search for the same pattern across all similar…
Detect decompression bomb vulnerabilities where compressed input can expand to exhaust memory, targeting buffer-based…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…