Laravel Blue Team Review
Defensive (blue team) review of a Laravel (PHP) backend codebase: find poor, unsafe,
and non-maintainable practices, rank them by risk, and recommend project-local fixes. The
audit is read-only; its only artefact is a Markdown report.
Use this skill for Laravel apps specifically. For a broader web-security audit against the
OWASP ASVS, use the audit-owasp-asvs skill instead.
1. Hard operational rules (non-destructive)
Identical to the audit-owasp-asvs skill. Never break these:
- Read-only inspection only. Use read/find tools (read, list, glob, grep) and
read-only shell commands (
ls, rg, git log, git show, git status,
git diff, find). Do not use edit, write, move, delete, or patch tools on
project files.
- Never run the application. No
php artisan commands, composer install/update,
phpunit, npm run, docker compose, or project scripts. Do not install packages
or run migrations. Static review only.
- No network activity against the target. Do not
curl/wget/probe the app, its
API, or its hosts. No active scanning or exploitation.
- No side effects. Do not start servers/daemons/background jobs. Do not touch the
.git index (git add/commit/reset).
- Secrets handling. If credentials/keys are found, do not log or reproduce the
full value; record
file:line and the secret type.
- Report is the only artefact. Write the report as a new Markdown file (default
reports/laravel-blue-team-review-<yyyy-mm-dd>.md), never overwriting existing files.
If unsure about the path, present the report in chat first.
If a requested action would violate a rule, refuse and explain which rule blocks it.
2. What this skill checks
Seven domains of Laravel-specific bad practices. The full checklist with detection
patterns, CWE references, and fixes lives in
references/laravel-checklist.md - use it as the authoritative catalog:
| Domain |
Focus |
| LB-SEC Secure Coding & Injection |
Raw SQL (DB::raw, whereRaw, selectRaw, orderByRaw), string-built queries, mass assignment, SSRF, command injection, unsafe file uploads, env() misuse. |
| LB-AUTHZ Authorization |
Missing policies/gates, unguarded routes, IDOR (user-supplied ids), admin-only operations without checks. |
| LB-XSS Output & Client-side |
Unescaped Blade {!! !!} , unvalidated output to JS, missing e() on user data. |
| LB-CONF Secrets & Configuration |
Committed .env, hardcoded secrets, APP_DEBUG=true, weak cookie/session config, unset APP_KEY. |
| LB-DATA Data, Storage & Performance |
N+1 queries, sensitive data at rest in plaintext, public storage exposure, unbounded queries. |
| LB-AUTHN Auth & Session |
Weak password hashing, missing rate limiting, CSRF disabled, missing session regeneration. |
| LB-APP API, Application & Dependencies |
Unprotected API routes, no throttle, no transactions, unsupported Laravel/PHP versions, missing composer.lock. |
3. Severity and priority model
Every finding gets a priority P0-P3, findings sorted P0 -> P3 in the report.
| Priority |
Label |
Typical conditions |
| P0 |
Critical |
Remote exploitation without auth: SQL/command injection, SSRF, exposed secrets, unsupported Laravel (EOL, no security patches), mass assignment leading to privilege escalation. |
| P1 |
High |
Exploitable with a precondition: IDOR/IDOR-style object access, broken authorization on sensitive operations, XSS on sensitive surfaces, debug enabled in prod, weak password hashing, CSRF disabled. |
| P2 |
Medium |
Defense-in-depth / hardening: missing rate limiting, no CSRF on forms, insecure cookie flags, N+1 on hot paths (performance/DoS-ish), sensitive data plaintext at rest in non-critical tables, dependency hygiene (Laravel 12 security-only). |
| P3 |
Low |
Quality/maintainability only: N+1 on cold paths, missing transactions, no Form Request classes, minor logging issues. |
Adjust by likelihood x impact in the actual context; add the domain ID and, where
relevant, the CWE next to each finding.
4. Workflow
Phase 0 - Scope
- Confirm the audit target: whole repo or specific modules (e.g. "the API", "Auth
module"). Default: whole repo. Ask the Laravel version and PHP version if not inferable
from
composer.json.
- Note the report path (default
reports/). Do not stall; defaults are fine.
Phase 1 - Read-only reconnaissance
- Read
composer.json + composer.lock if present - record Laravel version, PHP
requirement, notable packages (Sanctum/Passport, Horizon, Scout, admin panels).
- Map the structure:
app/ (Http/Controllers, Models, Http/Requests, Policies),
routes/ (web.php, api.php, console.php), config/, .env.example, resources/views,
database/.
- Record whether the repo is a standard Laravel app and its approximate size.
Phase 2 - Checklist-driven verification
For each checklist item in references/laravel-checklist.md:
- Run the suggested read-only searches (patterns in the checklist), read the relevant
controllers/models/routes/config/blade views.
- Assign a verdict:
PASS (good), FAIL (bad practice present), PARTIAL (present but
mitigated/limited), NOT-APPLICABLE, NOT-VERIFIABLE (needs runtime, e.g. .env
values in a dev repo - check .env.example and config defaults instead).
- Record evidence as
path:line with a 1-3 sentence rationale for every
FAIL/PARTIAL/NOT-VERIFIABLE. Every finding must trace to observed code.
Phase 3 - Scoring
- Assign P0-P3 per the table in section 3, considering likelihood and impact in this
specific app (public-facing? sensitive data? admin area?).
Phase 4 - Report
Use templates/laravel-review-report.md. Required sections:
- Header (project, date, Laravel/PHP versions, scope, method).
- Executive summary (product-owner readable): overall posture, counts by severity,
top 3-5 risks, and one line about framework support status (supported / security-only
/ EOL).
- Findings sorted P0 -> P3: priority badge,
LB-<domain>-NN, CWE, title, verdict,
evidence path:line, impact, and a concrete "How to remediate" for this codebase.
- Domain compliance matrix (counts + pass rate).
- Remediation roadmap (ordered work items).
- Not-verifiable list + limitations.
5. Framework support check (blue team)
Check composer.json for the laravel/framework version and compare to the official
support policy (see references/laravel-checklist.md, item LB-APP-DEP-04). As of
<2026-09>: Laravel 13 current (security until 2028-03), 12 security-fixes-only
(until 2027-02), 11 and older = EOL - treat EOL as P1, security-only as P2, and
state it in the report.
6. Remediation guidance in the report
Every FAIL/PARTIAL ends with a concrete "How to remediate" mapped to the project's stack
(e.g. "use where('col', ?) binding in app/Services/UserService.php", "replace
Model::create($request->all()) with a UserRequest + visible $fillable", "set
APP_DEBUG=false and secrets via env in .env + configure the deploy pipeline", "add
->with('orders') in UserController@index"). Point at exact files so findings become
backlog items.
7. Limitations
- Static, at-rest review: runtime
.env, live config, and external integrations are not
executed. Mark such items NOT-VERIFIABLE instead of guessing.
- Absence of evidence is not evidence of security.
- N+1 and similar quality findings are flagged as guidance, not proof of production
impact - the report says so.
- All findings must be traceable to files read during the audit.
8. Resources
references/laravel-checklist.md - authoritative checklist: 7 domains, detection
patterns, CWE, baseline severity, and fixes.
templates/laravel-review-report.md - the report skeleton.
1---2name: laravel-blue-team-review3description: Defensive (blue team) review of Laravel PHP backend projects. Detect unsafe and non-maintainable practices - SQL injection via raw queries, mass assignment, missing authorization, N+1 queries, unescaped Blade output, committed secrets, insecure config, weak authentication/session handling, unsupported Laravel versions - and produce a severity-ranked remediation report readable by product owners and security engineers. Use when the user asks to audit a Laravel app, review PHP/Laravel code for bad practices, run a defensive security review of a Laravel backend, or get Laravel findings classified by priority. Triggers: laravel, php, blue team, defensive, code review, best practices, vulnerable, vuln, audit, securite.4---56# Laravel Blue Team Review78Defensive (blue team) review of a **Laravel (PHP) backend** codebase: find poor, unsafe,9and non-maintainable practices, rank them by risk, and recommend project-local fixes. The10audit is **read-only**; its only artefact is a Markdown report.1112Use this skill for Laravel apps specifically. For a broader web-security audit against the13OWASP ASVS, use the `audit-owasp-asvs` skill instead.1415## 1. Hard operational rules (non-destructive)1617Identical to the `audit-owasp-asvs` skill. Never break these:1819- **Read-only inspection only.** Use read/find tools (read, list, glob, grep) and20 read-only shell commands (`ls`, `rg`, `git log`, `git show`, `git status`,21 `git diff`, `find`). Do **not** use edit, write, move, delete, or patch tools on22 project files.23- **Never run the application.** No `php artisan` commands, `composer install/update`,24 `phpunit`, `npm run`, `docker compose`, or project scripts. Do **not** install packages25 or run migrations. Static review only.26- **No network activity against the target.** Do not `curl`/`wget`/probe the app, its27 API, or its hosts. No active scanning or exploitation.28- **No side effects.** Do not start servers/daemons/background jobs. Do not touch the29 `.git` index (`git add`/`commit`/`reset`).30- **Secrets handling.** If credentials/keys are found, do **not** log or reproduce the31 full value; record `file:line` and the secret type.32- **Report is the only artefact.** Write the report as a **new** Markdown file (default33 `reports/laravel-blue-team-review-<yyyy-mm-dd>.md`), never overwriting existing files.34 If unsure about the path, present the report in chat first.3536If a requested action would violate a rule, refuse and explain which rule blocks it.3738## 2. What this skill checks3940Seven domains of Laravel-specific bad practices. The full checklist with detection41patterns, CWE references, and fixes lives in42`references/laravel-checklist.md` - use it as the authoritative catalog:4344| Domain | Focus |45|--------|-------|46| **LB-SEC** Secure Coding & Injection | Raw SQL (`DB::raw`, `whereRaw`, `selectRaw`, `orderByRaw`), string-built queries, mass assignment, SSRF, command injection, unsafe file uploads, `env()` misuse. |47| **LB-AUTHZ** Authorization | Missing policies/gates, unguarded routes, IDOR (user-supplied ids), admin-only operations without checks. |48| **LB-XSS** Output & Client-side | Unescaped Blade `{!! !!}` , unvalidated output to JS, missing `e()` on user data. |49| **LB-CONF** Secrets & Configuration | Committed `.env`, hardcoded secrets, `APP_DEBUG=true`, weak cookie/session config, unset `APP_KEY`. |50| **LB-DATA** Data, Storage & Performance | N+1 queries, sensitive data at rest in plaintext, public storage exposure, unbounded queries. |51| **LB-AUTHN** Auth & Session | Weak password hashing, missing rate limiting, CSRF disabled, missing session regeneration. |52| **LB-APP** API, Application & Dependencies | Unprotected API routes, no throttle, no transactions, unsupported Laravel/PHP versions, missing `composer.lock`. |5354## 3. Severity and priority model5556Every finding gets a priority **P0-P3**, findings sorted P0 -> P3 in the report.5758| Priority | Label | Typical conditions |59|----------|-------|--------------------|60| **P0** | Critical | Remote exploitation without auth: SQL/command injection, SSRF, exposed secrets, unsupported Laravel (**EOL, no security patches**), mass assignment leading to privilege escalation. |61| **P1** | High | Exploitable with a precondition: IDOR/IDOR-style object access, broken authorization on sensitive operations, XSS on sensitive surfaces, debug enabled in prod, weak password hashing, CSRF disabled. |62| **P2** | Medium | Defense-in-depth / hardening: missing rate limiting, no CSRF on forms, insecure cookie flags, N+1 on hot paths (performance/DoS-ish), sensitive data plaintext at rest in non-critical tables, dependency hygiene (Laravel 12 security-only). |63| **P3** | Low | Quality/maintainability only: N+1 on cold paths, missing transactions, no Form Request classes, minor logging issues. |6465Adjust by likelihood x impact in the actual context; add the domain ID and, where66relevant, the CWE next to each finding.6768## 4. Workflow6970### Phase 0 - Scope71- Confirm the audit target: whole repo or specific modules (e.g. "the API", "Auth72 module"). Default: whole repo. Ask the Laravel version and PHP version if not inferable73 from `composer.json`.74- Note the report path (default `reports/`). Do not stall; defaults are fine.7576### Phase 1 - Read-only reconnaissance77- Read `composer.json` + `composer.lock` if present - record Laravel version, PHP78 requirement, notable packages (Sanctum/Passport, Horizon, Scout, admin panels).79- Map the structure: `app/` (Http/Controllers, Models, Http/Requests, Policies),80 `routes/` (web.php, api.php, console.php), `config/`, `.env.example`, `resources/views`,81 `database/`.82- Record whether the repo is a standard Laravel app and its approximate size.8384### Phase 2 - Checklist-driven verification85For each checklist item in `references/laravel-checklist.md`:86- Run the suggested read-only searches (patterns in the checklist), read the relevant87 controllers/models/routes/config/blade views.88- Assign a verdict: `PASS` (good), `FAIL` (bad practice present), `PARTIAL` (present but89 mitigated/limited), `NOT-APPLICABLE`, `NOT-VERIFIABLE` (needs runtime, e.g. `.env`90 values in a dev repo - check `.env.example` and config defaults instead).91- Record evidence as `path:line` with a 1-3 sentence rationale for every92 FAIL/PARTIAL/NOT-VERIFIABLE. Every finding must trace to observed code.9394### Phase 3 - Scoring95- Assign P0-P3 per the table in section 3, considering likelihood and impact in this96 specific app (public-facing? sensitive data? admin area?).9798### Phase 4 - Report99Use `templates/laravel-review-report.md`. Required sections:1001. Header (project, date, Laravel/PHP versions, scope, method).1012. **Executive summary** (product-owner readable): overall posture, counts by severity,102 top 3-5 risks, and one line about framework support status (supported / security-only103 / EOL).1043. **Findings sorted P0 -> P3**: priority badge, `LB-<domain>-NN`, CWE, title, verdict,105 evidence `path:line`, impact, and a concrete "How to remediate" for this codebase.1064. Domain compliance matrix (counts + pass rate).1075. **Remediation roadmap** (ordered work items).1086. Not-verifiable list + limitations.109110## 5. Framework support check (blue team)111112Check `composer.json` for the `laravel/framework` version and compare to the official113support policy (see `references/laravel-checklist.md`, item LB-APP-DEP-04). As of114<2026-09>: Laravel **13** current (security until 2028-03), **12** security-fixes-only115(until 2027-02), **11 and older = EOL** - treat EOL as P1, security-only as P2, and116state it in the report.117118## 6. Remediation guidance in the report119120Every FAIL/PARTIAL ends with a concrete "How to remediate" mapped to the project's stack121(e.g. "use `where('col', ?)` binding in `app/Services/UserService.php`", "replace122`Model::create($request->all())` with a `UserRequest` + visible `$fillable`", "set123`APP_DEBUG=false` and secrets via env in `.env` + configure the deploy pipeline", "add124`->with('orders')` in `UserController@index`"). Point at exact files so findings become125backlog items.126127## 7. Limitations128129- Static, at-rest review: runtime `.env`, live config, and external integrations are not130 executed. Mark such items `NOT-VERIFIABLE` instead of guessing.131- Absence of evidence is not evidence of security.132- N+1 and similar quality findings are flagged as guidance, not proof of production133 impact - the report says so.134- All findings must be traceable to files read during the audit.135136## 8. Resources137138- `references/laravel-checklist.md` - authoritative checklist: 7 domains, detection139 patterns, CWE, baseline severity, and fixes.140- `templates/laravel-review-report.md` - the report skeleton.