advisory-mining
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or similar patterns in related packages.
Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper sanitization.
$ npx -y skills add ByamB4/find-cve-agent --skill command-injection --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/command-injectionContext preview
The summary Claude sees to decide when to auto-load this skill.
Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper sanitization.
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.
Repo: ByamB4/find-cve-agent
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or similar patterns in related packages.
Detect authentication and authorization bypass vulnerabilities including missing auth middleware, JWT algorithm confusion, IDOR, and session fixation.
Detect code injection vulnerabilities in packages that dynamically generate or evaluate code via new Function(), eval(), vm.run*, or template literal…
Cross-pollination multiplier technique: find a vulnerability in one package, then search for the same pattern across all similar packages to multiply findings.
Detect decompression bomb vulnerabilities where compressed input can expand to exhaust memory, targeting buffer-based decompression without size limits.
Detect XML/SVG/YAML entity expansion (Billion Laughs) vulnerabilities in parsers that allow unbounded entity definitions.