Skip to content
Security
Command

/sinks

[beta] Search for dangerous functions (sinks) and auto-discover output patterns

From plugin
vuln-scout
2615 skills9 agents15 commands
> /plugin marketplace add allsmog/vuln-scout
> /plugin install vuln-scout@vuln-scout

Command definition

sinks.md
name: sinks
description: "[beta] Search for dangerous functions (sinks) and auto-discover output patterns"
argument-hint: "[language] [--discover] [--scope name]"
allowed-tools:
  - Glob
  - Grep
  - Read
  - Bash
  - TodoWrite

Sink Search Command

Search the codebase for dangerous functions that could lead to vulnerabilities. Optionally auto-discover logging patterns and sensitive data sources.

Flags

| Flag | Effect | |------|--------| | `--discover` | Auto-discover logging patterns and sensitive sources first | | `--scope name` | Use pre-created scope file |

Execution

Step 1: Determine Language

If language argument provided:

  • Use that language's sink patterns

If no language argument:

  • Detect from file extensions using Glob
  • Search for: *.php, *.java, *.py, *.js, *.ts, *.cs, *.go, *.rb

Step 1.5: Auto-Discovery Mode (if --discover)

When `--discover` flag is provided, first identify codebase-specific patterns:

**Discover Logging Patterns:**

# Go
grep -rhoE "\w+\.(Error|Info|Debug|Warn|Fatal|Log)\w*\s*\(" --include="*.go" | sort | uniq -c | sort -rn | head -10

# Python
grep -rhoE "(logging|logger|log)\.(error|info|debug|warning)\s*\(" --include="*.py" | sort | uniq -c | sort -rn | head -10

# JavaScript/TypeScript
grep -rhoE "(console|logger|log)\.(error|info|debug|warn|log)\s*\(" --include="*.js" --include="*.ts" | sort | uniq -c | sort -rn | head -10

**Discover Sensitive Sources:**

# Variable names with sensitive patterns
grep -rniE "\b\w*(secret|password|apikey|token|credential|private.?key)\w*\b" --include="*.go" --include="*.py" --include="*.java" --include="*.js" | grep -v "_test" | head -20

**Output discovered patterns** before running standard sink search.

Step 2: Search for Sinks by Category

For the target language, search these categories in order:

**Command Execution** (Critical):

  • PHP: exec, system, passthru, shell_exec, popen, proc_open
  • Java: Runtime.exec, ProcessBuilder
  • Python: os.system, subprocess, os.popen
  • Node.js: child_process
  • .NET: Process.Start
  • Go: exec.Command
  • Ruby: system, exec, backticks

**Code Execution** (Critical):

  • PHP: eval, assert, create_function, preg_replace with /e
  • Java: ScriptEngine.eval, OGNL, MVEL, SpEL
  • Python: eval, exec, compile
  • Node.js: eval, Function constructor, vm module
  • .NET: CSharpCodeProvider, Assembly.Load
  • Ruby: eval, instance_eval, class_eval

**Deserialization** (Critical):

  • PHP: unserialize
  • Java: readObject, XMLDecoder, XStream
  • Python: pickle.loads, yaml.load
  • Node.js: node-serialize
  • .NET: BinaryFormatter, Deserialize

**SQL** (High):

  • String concatenation in queries
  • Raw query methods without parameterization

**File Operations** (High):

  • Include/require with variables
  • File read/write with user input

Step 3: Present Results

Format output as:

## Sink Search Results

### Command Execution (X findings)
- path/to/file.php:42 - exec($cmd)
- path/to/file.php:87 - system($command)

### Code Execution (X findings)
- path/to/file.php:123 - eval($code)

### Deserialization (X findings)
- path/to/file.php:56 - unserialize($data)

### SQL (X findings)
- path/to/file.php:234 - query("SELECT...{$id}")

### File Operations (X findings)
- path/to/file.php:345 - include($page)

---
Total: X potential sinks identified
Recommendation: Trace data flow for each to determine exploitability

Notes

  • Show context around each finding (-B 2 -A 2)
  • Sort by severity (Command > Code > Deserialization > SQL > File)
  • Highlight findings with direct user input ($_GET, $_POST, request.*)
  • Suggest next step: trace data flow or run full audit
Read more
@allsmog
Ships withvuln-scout

AI-powered whitebox penetration testing plugin for Claude Code. 9 languages, 22 skills, 7 autonomous agents. STRIDE threat modeling, OWASP 2025 coverage, polyglot monorepo support.

2635 skills9 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
26
Star history of allsmog/vuln-scout on GitHub, a chart by star-history.com

Other commands on vuln-scout.

auto-fix

auto-fix

Command

[experimental] Auto-remediate verified findings by generating patches and optionally creating a PR

@allsmog@allsmogInstall Command
create-rule

create-rule

Command

[experimental] Create a custom Semgrep detection rule from a confirmed vulnerability pattern

@allsmog@allsmogInstall Command
diff

diff

Command

[stable] Compare security posture between two git refs to find new/fixed vulnerabilities and track regression

@allsmog@allsmogInstall Command
full-audit

full-audit

Command

[stable] End-to-end security audit with hotspot-aware framework pivots, shared findings.json schema, and CI-friendly workflow…

@allsmog@allsmogInstall Command
mobile-audit

mobile-audit

Command

[beta] Audit a decompiled Android target — scans jadx_out/sources + apktool_out together and merges findings

@allsmog@allsmogInstall Command
mutate

mutate

Command

[experimental] Security mutation testing -- weaken security controls and check if the scanner detects the resulting vulnerability

@allsmog@allsmogInstall Command

More commands from other plugins.

deslop-reborn

deslop-reborn

Command

One iteration of the IronClaw Reborn de-slop loop — take ONE Reborn crate, fan out parallel review sub-agents (thermo-nuclear…

@nearai@nearaiInstall Command
audit

audit

Command

Audit a file, directory, or whole repo for insecure default configuration: fallback secrets, default credentials, fail-open…

@trailofbits@trailofbitsInstall Command
arsenal

arsenal

Command

Show which external bug-bounty tools are installed on this machine and print install hints for the missing ones. Curated from…

@awarexone@awarexoneInstall Command