mirror of
https://github.com/CyberSecurityUP/NeuroSploit.git
synced 2026-06-30 07:15:30 +02:00
v3.4.x: intelligent agent selection, whitebox, recon/code agents, Gemini, artifacts, RL, XBOW GUI
Harness intelligence: - After recon, the model SELECTS which specialist agents match the target (select_agents) — runs the relevant subset, not blindly top-N - RL reward store (rl.rs): per-agent weights persist to data/rl_state_rs.json, reward validated findings (severity-weighted), decay idle, bias next run - Run artifacts persisted as JSON + MD (recon, exploitation transcript, findings, html report) under runs/<target>-<ts>/ for reuse by other AIs Whitebox mode: - run_whitebox: walks a repo, builds bounded source context, runs code agents, validates by adversarial vote. CLI `whitebox <path>` + web "White-box" mode Agents: +12 recon (subdomain/tech/js/api/secrets/dns/content/param/waf/cloud/ graphql/osint) and +24 code SAST reviewers (sqli/cmdi/path/ssrf/xss/deser/ secrets/crypto/authz/idor/xxe/redirect/ssti/race/eval/csrf/random/logging/ upload/mass-assign/jwt/cors). Loader gains recon/ + code/ categories → 249 total Models: +Google Gemini provider (API + gemini CLI subscription); installed_cli_ backends now detects gemini; chat_cli handles gemini/codex/grok + optional Playwright MCP (.mcp.json) on the subscription path with autonomy flags GUI: full XBOW-style redesign — sidebar (Operate/Library), topbar status, mode segment (black-box/white-box), model panel, live console, severity cards, agent browser with category filters, models view; responsive + aligned Verified: cargo build --release clean; CLI agents/whitebox; LIVE subscription run shows model selecting 23→4 agents, RL update, artifacts written; GUI + white-box toggle in Playwright. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# Source Authentication/Authorization Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for broken authentication/authorization in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- Missing auth checks on sensitive routes; client-trusted role flags
|
||||
- Comparisons of secrets without constant-time; weak session handling
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Authentication/Authorization Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-287
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Privilege escalation, account takeover
|
||||
- Remediation: Enforce server-side authz on every action; harden sessions
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for broken authentication/authorization. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Command Injection Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for OS command injection in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- `os.system`, `subprocess(..., shell=True)`, `exec`, backticks with user input
|
||||
- Unsanitized input concatenated into shell strings
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Command Injection Reviewer at [file:line]
|
||||
- Severity: Critical
|
||||
- CWE: CWE-78
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Remote code execution on the host
|
||||
- Remediation: Avoid shells; pass argument arrays; validate input
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for OS command injection. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source CORS Misconfiguration Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for permissive CORS in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- `Access-Control-Allow-Origin: *` with credentials; reflecting Origin
|
||||
- Wildcard or unchecked origin allowlists
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source CORS Misconfiguration Reviewer at [file:line]
|
||||
- Severity: Medium
|
||||
- CWE: CWE-942
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Cross-origin data theft
|
||||
- Remediation: Strict origin allowlist; never reflect Origin with credentials
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for permissive CORS. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source CSRF Protection Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for missing CSRF protection in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- State-changing POST/PUT/DELETE without CSRF tokens
|
||||
- CSRF protection globally disabled
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source CSRF Protection Reviewer at [file:line]
|
||||
- Severity: Medium
|
||||
- CWE: CWE-352
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Unauthorized state-changing actions
|
||||
- Remediation: Enable anti-CSRF tokens / SameSite cookies
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for missing CSRF protection. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source File Upload Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for insecure file upload handling in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- No type/extension/content validation; user-controlled filenames/paths
|
||||
- Uploads served from executable directories
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source File Upload Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-434
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Webshell upload, RCE
|
||||
- Remediation: Validate type/size; randomize names; store outside webroot
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for insecure file upload handling. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Hardcoded Secrets Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for hardcoded credentials/keys in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- API keys, passwords, tokens, private keys committed in source/config
|
||||
- High-entropy strings assigned to credential-like names
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Hardcoded Secrets Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-798
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Credential/key compromise
|
||||
- Remediation: Move secrets to a vault/env; rotate exposed values
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for hardcoded credentials/keys. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source IDOR / Access Control Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for insecure direct object references in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- Object lookups by user-supplied id without ownership checks
|
||||
- Direct DB fetch on `request.id` with no scoping
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source IDOR / Access Control Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-639
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Cross-account data access
|
||||
- Remediation: Enforce per-object ownership/authorization checks
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for insecure direct object references. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Insecure Deserialization Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for unsafe deserialization in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- `pickle.loads`, `yaml.load` (unsafe), Java/PHP native deserialization on untrusted data
|
||||
- Object deserialization of request data
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Insecure Deserialization Reviewer at [file:line]
|
||||
- Severity: Critical
|
||||
- CWE: CWE-502
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Remote code execution
|
||||
- Remediation: Use safe formats/loaders; never deserialize untrusted data
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for unsafe deserialization. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Insecure Randomness Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for predictable randomness for security in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- `random`/`Math.random` used for tokens, IDs, passwords, OTPs
|
||||
- Seeded or time-based randomness for secrets
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Insecure Randomness Reviewer at [file:line]
|
||||
- Severity: Medium
|
||||
- CWE: CWE-330
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Token/session prediction
|
||||
- Remediation: Use a CSPRNG (secrets, crypto.randomBytes)
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for predictable randomness for security. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source JWT Misuse Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for JWT verification flaws in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- `verify=False`, alg `none` accepted, secret not validated
|
||||
- Algorithm not pinned; weak/hardcoded secret
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source JWT Misuse Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-347
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Token forgery, auth bypass
|
||||
- Remediation: Pin algorithm; verify signature; strong secret/keys
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for JWT verification flaws. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Sensitive Logging Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for sensitive data in logs in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- Logging passwords, tokens, PII, full requests
|
||||
- Debug logging of secrets in production paths
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Sensitive Logging Reviewer at [file:line]
|
||||
- Severity: Low
|
||||
- CWE: CWE-532
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Credential/PII exposure via logs
|
||||
- Remediation: Redact sensitive fields; scope debug logging
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for sensitive data in logs. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Mass Assignment Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for mass assignment / over-binding in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- Binding whole request body to models (`Model(**request)`, `update_attributes`)
|
||||
- No allowlist of bindable fields
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Mass Assignment Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-915
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Privilege escalation via hidden fields
|
||||
- Remediation: Allowlist bindable fields; use DTOs
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for mass assignment / over-binding. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Open Redirect Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for open redirect in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- Redirects built from user input (redirect(request.param))
|
||||
- No allowlist of redirect destinations
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Open Redirect Reviewer at [file:line]
|
||||
- Severity: Medium
|
||||
- CWE: CWE-601
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Phishing, OAuth token theft
|
||||
- Remediation: Allowlist redirect targets; use relative paths
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for open redirect. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Path Traversal Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for path traversal / arbitrary file access in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- User input in file paths (open/read/sendFile) without normalization
|
||||
- Missing checks for `../` and absolute paths
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Path Traversal Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-22
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Arbitrary file read/write
|
||||
- Remediation: Canonicalize and confine paths to a safe base directory
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for path traversal / arbitrary file access. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Race Condition Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for TOCTOU / concurrency flaws in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- Check-then-act on shared state without locking
|
||||
- Non-atomic balance/quota/idempotency updates
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Race Condition Reviewer at [file:line]
|
||||
- Severity: Medium
|
||||
- CWE: CWE-362
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Double-spend, state corruption
|
||||
- Remediation: Use atomic operations, locks, or transactions
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for TOCTOU / concurrency flaws. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source ORM Raw-Query Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for unsafe raw ORM queries in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- `.raw()`, `.extra()`, query builders with string interpolation
|
||||
- Raw fragments mixing user input
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source ORM Raw-Query Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-89
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: SQL injection via ORM
|
||||
- Remediation: Use parameter binding even in raw queries
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for unsafe raw ORM queries. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source SQL Injection Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for SQL injection in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- String concatenation/interpolation into SQL (f-strings, +, .format) passed to execute()
|
||||
- Raw queries bypassing the ORM; `.raw(`, `cursor.execute(... % ...)`
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source SQL Injection Reviewer at [file:line]
|
||||
- Severity: Critical
|
||||
- CWE: CWE-89
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Database compromise, data exfiltration
|
||||
- Remediation: Use parameterized queries / ORM bindings
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for SQL injection. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source SSRF Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for server-side request forgery in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- User-controlled URLs passed to HTTP clients (requests/fetch/curl)
|
||||
- No allowlist or scheme/host validation
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source SSRF Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-918
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Internal network access, cloud metadata theft
|
||||
- Remediation: Allowlist destinations; block internal ranges and redirects
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for server-side request forgery. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source SSRF-via-Redirect Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for SSRF through redirect following in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- HTTP clients following redirects to user-controlled URLs
|
||||
- No re-validation of redirect targets against allowlist
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source SSRF-via-Redirect Reviewer at [file:line]
|
||||
- Severity: Medium
|
||||
- CWE: CWE-918
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Internal access via redirect
|
||||
- Remediation: Disable/limit redirects; re-validate each hop
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for SSRF through redirect following. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Template Injection Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for server-side template injection in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- User input concatenated into template strings then rendered
|
||||
- `render_template_string`, dynamic template construction
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Template Injection Reviewer at [file:line]
|
||||
- Severity: Critical
|
||||
- CWE: CWE-1336
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Remote code execution
|
||||
- Remediation: Never render user input as templates; sandbox
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for server-side template injection. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Unsafe Eval Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for dynamic code evaluation in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- `eval`, `exec`, `Function()`, `setTimeout(string)` on user input
|
||||
- Dynamic import/require of user-controlled names
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Unsafe Eval Reviewer at [file:line]
|
||||
- Severity: Critical
|
||||
- CWE: CWE-95
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Remote code execution
|
||||
- Remediation: Eliminate dynamic eval; use safe parsers/dispatch tables
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for dynamic code evaluation. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source Weak Cryptography Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for weak or misused cryptography in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- MD5/SHA1 for passwords; ECB mode; static IV/salt; hardcoded keys
|
||||
- Custom/rolled crypto; weak random for security tokens
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source Weak Cryptography Reviewer at [file:line]
|
||||
- Severity: Medium
|
||||
- CWE: CWE-327
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Data exposure, token forgery
|
||||
- Remediation: Use vetted algorithms (bcrypt/argon2, AES-GCM), random IVs, CSPRNG
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for weak or misused cryptography. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source XSS Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for cross-site scripting (output encoding) in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- Unescaped user input rendered to HTML (innerHTML, dangerouslySetInnerHTML, `|safe`, `v-html`)
|
||||
- Template autoescaping disabled
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source XSS Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-79
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: Session theft, account takeover
|
||||
- Remediation: Context-aware output encoding; keep autoescaping on; CSP
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for cross-site scripting (output encoding). Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Source XXE Reviewer Agent
|
||||
|
||||
## User Prompt
|
||||
You are reviewing the source code of **{target}** for XML external entity processing in the source code.
|
||||
|
||||
**Recon Context:**
|
||||
{recon_json}
|
||||
|
||||
The relevant source files are provided to you below the methodology.
|
||||
|
||||
**METHODOLOGY:**
|
||||
|
||||
### 1. Locate sinks/sources
|
||||
- XML parsers with external entities/DTDs enabled on untrusted input
|
||||
- `resolve_entities=True`, default-config parsers
|
||||
|
||||
### 2. Trace dataflow
|
||||
- Trace user-controlled input from source to the dangerous sink
|
||||
- Confirm the path is reachable and lacks sanitization/validation
|
||||
|
||||
### 3. Confirm exploitability
|
||||
- Quote the exact vulnerable lines (file:line)
|
||||
- Explain the concrete exploit and why existing controls don't stop it
|
||||
|
||||
### 4. Report Format
|
||||
For each CONFIRMED finding:
|
||||
```
|
||||
FINDING:
|
||||
- Title: Source XXE Reviewer at [file:line]
|
||||
- Severity: High
|
||||
- CWE: CWE-611
|
||||
- Endpoint: [file:line]
|
||||
- Vector: [what/where]
|
||||
- Payload: [PoC / vulnerable code snippet]
|
||||
- Evidence: [proof / exact code quoted]
|
||||
- Impact: File disclosure, SSRF
|
||||
- Remediation: Disable DTDs/external entities; use hardened parsers
|
||||
```
|
||||
|
||||
## System Prompt
|
||||
You are a white-box source reviewer for XML external entity processing. Report ONLY issues you can prove in the PROVIDED code by quoting the exact vulnerable lines (file:line) and a reachable dataflow from untrusted input. Never report sanitized, unreachable, or hypothetical code. If the snippet is insufficient, say so rather than guess.
|
||||
Reference in New Issue
Block a user