Laravel owasp security

From AsyrafHussin/agent-skills · View interactive version

Laravel owasp security is an AI agent skill from the GitHub repository AsyrafHussin/agent-skills. OWASP Top 10 security audit and secure coding guidelines for Laravel + React/Inertia.js applications. Use when auditing for vulnerabilities ("run OWASP audit", "security review", "check my app security") or writing secure Laravel code involving auth, payments, file uploads, or API design. Triggers o

How to use this skill

Skill file

Laravel OWASP Security

Dual-purpose security skill for Laravel 13 + React/Inertia.js applications. Run a full OWASP Top 10 audit against a codebase, or use as a secure coding reference when building features.

How to Audit

Step 1: Detect Stack

Check if the project uses React + Inertia.js by looking for:

If detected, state at the top of the report:

"React + Inertia.js detected — Laravel OWASP checklist AND React/Inertia security checks will both be applied."

If not detected, state:

"No React/Inertia.js detected — applying Laravel OWASP checklist only."

Step 2: Determine Scope

Step 3: Run Checklist

Work through every item below. For each, output:


OWASP Top 10 Checklist

1. Broken Access Control (A01:2021)

2. Cryptographic Failures (A02:2021)

3. Injection (A03:2021)

SQL & Mass Assignment:

XSS — Blade & React:

4. Insecure Design (A04:2021)

5. Security Misconfiguration (A05:2021)

6. Vulnerable & Outdated Components (A06:2021)

7. Identification & Authentication Failures (A07:2021)

Auth:

Cookie & Session:

8. Software & Data Integrity Failures (A08:2021)

CSRF:

Deserialization:

9. Security Logging & Monitoring Failures (A09:2021)

10. Server-Side Request Forgery — SSRF (A10:2021)


Additional Checks

Not part of the OWASP Top 10 but critical for Laravel applications.

Command Injection & Dangerous Functions

Security Headers


React + Inertia.js Checks

Only run if React + Inertia.js detected in Step 1.

R1. XSS in React Components

R2. Inertia.js Data Exposure (Critical)

R3. CSRF in Inertia.js

R4. Authentication State in React

R5. Sensitive Data in Browser

R6. Dependency Security


Output Format

Structure the audit report as:

## Laravel OWASP Security Audit Report

> React + Inertia.js detected — Laravel OWASP checklist AND React/Inertia security checks will both be applied.

### 1. Broken Access Control (A01:2021)
- **PASS** `app/Http/Middleware/RoleMiddleware.php` — role middleware applied to all route groups
- **FAIL** `app/Http/Controllers/PaymentController.php:42` — Payment model fetched without ownership check (direct object reference exposure). Fix: scope the query to the authenticated user.

[Continue for all 10 OWASP checks + Additional Checks + R1–R6 React/Inertia checks]

---

## Summary

### Critical Issues (fix immediately)
1. ...

### Warnings (fix soon)
1. ...

### Passed
X checks passed.

### Recommended Commands
composer audit
npm audit

When to Apply for Guidance

Reference the rule files when:

Rule Categories by Priority

| Priority | Category | Impact | Rule File |

|----------|----------|--------|-----------|

| 1 | Broken Access Control | CRITICAL | sec-broken-access-control |

| 2 | Cryptographic Failures | CRITICAL | sec-cryptographic-failures |

| 3 | Injection Prevention | CRITICAL | sec-injection-prevention |

| 4 | XSS & React/Inertia | HIGH | sec-xss-react-inertia |

| 5 | CSRF Protection | HIGH | sec-csrf-protection |

| 6 | Security Misconfiguration | HIGH | sec-security-misconfiguration |

| 7 | Authentication & Rate Limiting | HIGH | sec-authentication-rate-limiting |

| 8 | Inertia Data Exposure | HIGH | sec-inertia-data-exposure |

Quick Reference

1. Broken Access Control (CRITICAL)

2. Cryptographic Failures (CRITICAL)

3. Injection Prevention (CRITICAL)

4. XSS & React/Inertia (HIGH)

5. CSRF Protection (HIGH)

6. Security Misconfiguration (HIGH)

7. Authentication & Rate Limiting (HIGH)

8. Inertia Data Exposure (HIGH)

How to Use

Read individual rule files for detailed explanations and code examples:

rules/sec-broken-access-control.md
rules/sec-cryptographic-failures.md
rules/sec-injection-prevention.md
rules/sec-xss-react-inertia.md
rules/sec-csrf-protection.md
rules/sec-security-misconfiguration.md
rules/sec-authentication-rate-limiting.md
rules/sec-inertia-data-exposure.md

Each rule file contains:

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.