advisory-mining
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or…
Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper sanitization.
Claude Code
$ npx -y skills add ByamB4/find-cve-agent --skill command-injection --agent claude-code
Codex
$ npx skills add ByamB4/find-cve-agent --skill command-injection -a codex -y
Cursor
$ npx skills add ByamB4/find-cve-agent --skill command-injection -a cursor -y
Gemini CLI
$ npx skills add ByamB4/find-cve-agent --skill command-injection -a gemini-cli -y
GitHub Copilot
$ npx skills add ByamB4/find-cve-agent --skill command-injection -a github-copilot -y
OpenCode
$ npx skills add ByamB4/find-cve-agent --skill command-injection -a opencode -y
Windsurf
$ npx skills add ByamB4/find-cve-agent --skill command-injection -a windsurf -y
name: command-injection
description: "Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper sanitization."
metadata:
filePattern:
- "**/*.js"
- "**/*.ts"
- "**/*.py"
- "**/*.go"
- "**/*.rb"
- "**/*.php"
bashPattern:
- "semgrep.*cmdi"
- "grep.*(exec|spawn|system|popen)"
priority: 90Audit any package that wraps CLI tools, runs build commands, processes files via external programs, or interfaces with git/ffmpeg/imagemagick/pandoc/etc.
CVSS is typically CRITICAL 9.8 for confirmed RCE.
# JavaScript/TypeScript — look for child_process usage
grep -rn "child_process" .
grep -rn "\.exec\('" .
grep -rn "\.execSync\(" .
grep -rn "spawn.*shell.*true" .
grep -rn "shelljs" .
# Python
grep -rn "os\.system\|os\.popen" .
grep -rn "subprocess.*shell.*True" .
grep -rn "commands\.getoutput\|commands\.getstatusoutput" .
# Go
grep -rn 'exec\.Command.*"bash"\|exec\.Command.*"sh"' .
# Ruby
grep -rn "system(\|%x{" . --include="*.rb"
grep -rn "IO\.popen\|Open3" .
# PHP
grep -rn "system(\|passthru(\|shell_exec(\|popen(" .
grep -rn "proc_open\|pcntl_exec" .For each sink: 1. What command string is constructed? 2. Is any part from user input (HTTP params, filenames, config values)? 3. Is the user input interpolated into a shell string or passed as an argument array?
grep -rn "escapeshellarg\|escapeshellcmd\|shlex\.quote\|shellescape" . grep -rn "sanitize\|escape\|clean\|validate" .
Verify sanitization is:
Even with execFile/spawn (no shell), check for:
// VULNERABLE — shell interprets metacharacters
const cp = require('child_process');
cp.exec(`convert ${inputFile} ${outputFile}`);
// Exploit: inputFile = "; id; #"cp.exec(`file "${filename}"`);
// Exploit: filename = '$(id).txt' or filename = '"; id; #"'// Even without shell, git interprets dangerous flags
cp.execFile('git', ['clone', userUrl, '--config', 'core.fsmonitor=id']);cp.exec(command, { env: { ...process.env, USER_INPUT: untrusted } });
// If command references $USER_INPUT or uses env vars unsafelycp.execFile('program', ['--option=' + userInput]);
// Exploit: userInput = "value\n--dangerous-flag"grep -rn "exec\(.*\+" . # String concatenation in exec
grep -rn "exec\(.*\$\{" . # Template literal in exec
grep -rn "exec\(.*%" . # Format string in exec (Python)grep -rn "execFile\|spawn" . # Then check if user input is in the args array without -- separator
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*,…
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…
Detect XML/SVG/YAML entity expansion (Billion Laughs) vulnerabilities in parsers that allow unbounded entity definitions.
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…