/viperclaw:viper-injection-oraclefrom viperclaw
Audits code for SQL, NoSQL, template, and OS command injection vulnerabilities. Verifies parameterization, allowlisting, and safe subprocess patterns.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
viper-injection-oracle)viper_taint_scan, viper_diff_oracle, viper_verify_and_reportviperclaw taint ./src --db .viperclaw/graph.db --output injection_audit.jsonflowchart LR
Input["Untrusted Request Param / Header / Body"] --> Validator["Type Cast & Allowlist Validator"] --> Builder["Parameterized Driver / AST Builder"] --> Engine["SQL DB / OS Kernel / Template Engine"]
Injection flaws occur when untrusted data is concatenated into a command or query string before parsing, allowing data values to alter the syntax tree (AST) of the target interpreter.
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint ./src --db .viperclaw/graph.db --output injection_audit.json
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(execute|query|raw|exec)\(\s*f."
rg -n "subprocess\.(Popen|run|call|check_output)\(.*shell\s*=\s*True"
rg -n "(render_template_string|jinja2\.Template\(|new Function\(|eval\()"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
INJ-01 | SQL Value Parameterization | 100% of SQL data values bound via prepared statements (?, $1, %s, :name). | String interpolation (f"...", fmt.Sprintf, +, .format()) inside SQL strings. |
INJ-02 | Dynamic SQL Identifier Allowlisting | Dynamic column/table/sort names (ORDER BY, GROUP BY) mapped through a hardcoded allowlist dictionary. | User input concatenated into ORDER BY ${req.query.sort} (cannot be parameterized by ?). |
INJ-03 | Second-Order SQL Taint Tracking | Database-stored values (usernames, webhook event bodies) are also parameterized when reused in later queries. | Stored user metadata concatenated into reporting or batch-job SQL queries. |
INJ-04 | Zero-Shell Subprocess Execution | OS commands executed via subprocess.run([bin, arg1], shell=False) or execFile with -- option terminator. | Use of os.system, popen, shell=True, or passing unvalidated -option flags to CLI binaries (Argument Injection, CWE-88). |
INJ-05 | NoSQL Scalar Type Enforcement | MongoDB/CouchDB query inputs validated as primitive strings/numbers; $where disabled. | Raw JSON objects ({"$ne": null}, {"$gt": ""}) passed from req.body into .findOne(). |
INJ-06 | Static Template Compilation (SSTI Defense) | Templates loaded exclusively from static files; user data passed only in the context dictionary. | User strings passed into Template(user_str).render() or render_template_string(). |
INJ-07 | LDAP / XPath / ORM Filter Escaping | LDAP filters escaped with ldap3.utils.conv.escape_filter_chars; ORM .extra()/.raw() avoided. | String concatenation in LDAP (&(uid=${user})) or Django extra(where=[...]). |
INJ-08 | CRLF & Header Injection Prevention | HTTP response headers and log lines strip \r and \n characters. | Unvalidated user strings written into Location or Set-Cookie headers. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.8) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | Unauthenticated OS Command Injection, SSTI RCE, or SQLi with database read/write. |
| HIGH (8.8) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | Authenticated SQLi, NoSQL operator auth gap, or argument injection leading to code execution. |
| MEDIUM (6.5) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N | Read-only boolean/time-based blind SQLi in a restricted reporting query. |
# ❌ VULNERABLE: Dynamic ORDER BY concatenation & shell=True subprocess call
def list_logs(sort_col: str, grep_term: str):
rows = cursor.execute(f"SELECT * FROM audit_logs ORDER BY {sort_col} DESC").fetchall()
out = subprocess.check_output(f"grep {grep_term} /var/log/app.log", shell=True)
return rows, out
# ✅ HARDENED: Strict identifier allowlist + shell=False with '--' argument terminator
ALLOWED_SORT_COLS = {"created_at": "created_at", "severity": "severity", "actor_id": "actor_id"}
def list_logs(sort_col: str, grep_term: str):
safe_col = ALLOWED_SORT_COLS.get(sort_col, "created_at")
rows = cursor.execute(f"SELECT * FROM audit_logs ORDER BY {safe_col} DESC").fetchall()
out = subprocess.run(["grep", "--fixed-strings", "--", grep_term, "/var/log/app.log"], capture_output=True, text=True, check=False).stdout
return rows, out
viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.npx claudepluginhub zahidoverflow/viperclaw --plugin viperclawOther plugins' skills for the same job