advisory-mining
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or…
Detect SQL injection where user input reaches SQL query construction through string concatenation, template literals, or ORM raw query methods.
Claude Code
$ npx -y skills add ByamB4/find-cve-agent --skill sqli --agent claude-code
Codex
$ npx skills add ByamB4/find-cve-agent --skill sqli -a codex -y
Cursor
$ npx skills add ByamB4/find-cve-agent --skill sqli -a cursor -y
Gemini CLI
$ npx skills add ByamB4/find-cve-agent --skill sqli -a gemini-cli -y
GitHub Copilot
$ npx skills add ByamB4/find-cve-agent --skill sqli -a github-copilot -y
OpenCode
$ npx skills add ByamB4/find-cve-agent --skill sqli -a opencode -y
Windsurf
$ npx skills add ByamB4/find-cve-agent --skill sqli -a windsurf -y
name: sqli
description: "Detect SQL injection where user input reaches SQL query construction through string concatenation, template literals, or ORM raw query methods."
metadata:
filePattern:
- "**/*.js"
- "**/*.ts"
- "**/*.py"
- "**/*.go"
- "**/*.rb"
- "**/*.php"
bashPattern:
- "semgrep.*sqli"
- "grep.*(query|execute|raw|cursor)"
priority: 85Audit database-backed applications, ORM wrappers, query builders, and any code that constructs SQL queries from user input.
# JavaScript
grep -rn "query(\|execute(\|\.raw(\|\.rawQuery(" .
grep -rn "knex\.raw\|sequelize\.query\|prisma\.\$queryRaw" .
# Python
grep -rn "cursor\.execute\|execute(\|executemany(" .
grep -rn "\.raw(\|RawSQL\|text(" .
grep -rn "f\".*SELECT\|f\".*INSERT\|f\".*UPDATE\|f\".*DELETE" .
# Go
grep -rn "db\.Query\|db\.Exec\|db\.QueryRow\|tx\.Query" .
grep -rn "fmt\.Sprintf.*SELECT\|fmt\.Sprintf.*INSERT" .
# Ruby
grep -rn "find_by_sql\|execute\|select_all\|where.*#\{" .
# PHP
grep -rn "query(\|prepare(\|exec(\|mysql_query\|mysqli_query" .# Template literals in SQL
grep -rn "query.*\`.*\$\{" . --include="*.js" --include="*.ts"
# String concatenation in SQL
grep -rn "SELECT.*\+\|INSERT.*\+\|UPDATE.*\+\|DELETE.*\+" .
# Python f-strings in SQL
grep -rn 'f".*SELECT\|f".*INSERT\|f".*UPDATE\|f".*DELETE' .
# Format strings in SQL
grep -rn "\.format(.*SELECT\|\.format(.*INSERT" .Parameterized queries are SAFE:
// SAFE: parameterized
db.query('SELECT * FROM users WHERE id = ?', [userId]);
// UNSAFE: string concatenation
db.query('SELECT * FROM users WHERE id = ' + userId);ORMs are generally safe, but `.raw()` / `.query()` methods often bypass protections:
// SAFE: ORM query builder
User.findOne({ where: { id: userId } });
// UNSAFE: raw query with interpolation
sequelize.query(`SELECT * FROM users WHERE id = ${userId}`);Some SQL elements CANNOT be parameterized:
If user input reaches these, it is SQLi even with prepared statements.
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…