Methodology for finding bugs, security vulnerabilities, and code issues in branches/PRs. Use when reviewing changes, conducting security reviews, or auditing code.
Instalação
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Methodology for finding bugs, security vulnerabilities, and code issues in branches/PRs. Use when reviewing changes, conducting security reviews, or auditing code.
Find Bugs
Systematic approach to find bugs, security vulnerabilities, and code quality issues.
When to Use
Reviewing pull requests
Conducting security reviews
Auditing code changes before deploy
Finding bugs in feature branches
Phase 1: Input Gathering
Get the Full Diff
# Get diff against main branch
git diff $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')...HEAD
# Or specific branch
git diff main...HEAD
# List changed files
git diff --name-only main...HEAD
Understand Context
What problem is being solved?
What files were changed?
Is there a related issue/ticket?
What's the expected behavior?
Phase 2: Attack Surface Mapping
For each changed file, identify:
Category
What to Find
User Inputs
Request params, body, headers, URL components
Database Queries
Eloquent, raw queries, whereRaw
Auth Checks
Middleware, $this->authorize(), @can
Session/State
Session writes, cache operations
External Calls
HTTP clients, API calls, webhooks
File Operations
Uploads, downloads, path handling
Laravel-Specific Patterns to Flag
// Flag these for review:
{!! $variable !!} // Raw output - XSS risk
DB::raw($userInput) // Raw SQL - injection risk$request->all() // Mass assignment riskStorage::path($userInput) // Path traversal risk
Phase 3: Security Checklist
Check EVERY item for EVERY changed file:
Injection
No raw queries with user input
No DB::raw() with concatenated variables
No whereRaw() without bindings
No exec(), shell_exec(), system() with user input
XSS
All user output uses {{ }} not {!! !!}
If {!! !!} used, content is sanitized
JSON output properly encoded
Authentication
Protected routes have auth middleware
Sensitive actions require reauthentication if needed
**File:Line** - Brief description
**Severity:** Critical | High | Medium | Low
**Problem:** What's wrong
**Evidence:** Why this is real (not already fixed, no test, etc.)
**Fix:** Concrete suggestion
**Reference:** OWASP, Laravel docs, etc.
Example Finding
**app/Http/Controllers/PostController.php:45** - SQL Injection
**Severity:** Critical
**Problem:** User input concatenated into raw query
```php
$posts = DB::select("SELECT * FROM posts WHERE title LIKE '%{$request->search}%'");
Evidence: No sanitization, no parameterization
Fix: Use bindings
$posts = DB::select(
"SELECT * FROM posts WHERE title LIKE ?",
['%' . $request->search . '%']
);