Loading...
Loading...
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 on security-related tasks, payment handling, authentication, or any request to audit a Laravel codebase.
npx skill4agent add asyrafhussin/agent-skills laravel-owasp-securityapp/Http/Middleware/HandleInertiaRequests.phpresources/js/.tsx.jsxinertiajs/inertia-laravelcomposer.json@inertiajs/reactpackage.json"React + Inertia.js detected — Laravel OWASP checklist AND React/Inertia security checks will both be applied."
"No React/Inertia.js detected — applying Laravel OWASP checklist only."
$ARGUMENTSfile:lineauthrole:admin->where('user_id', auth()->id())Hash::make()'hashed'Crypt::encryptString()'encrypted'APP_KEYURL::signedRoute()whereRaw()selectRaw()orderByRaw()?$request->all()create()fill()update()forceFill()forceCreate()$fillable$guarded = []$request->validated(){!! $userInput !!}{{ }}dangerouslySetInnerHTMLDOMPurify.sanitize()hrefsrceval()new Function()setTimeout(string)integrity="sha384-..."APP_DEBUG=false.env.gitignorestorage/bootstrap/cache/APP_KEYallowed_origins['*']composer auditnpm auditthrottleRateLimiterLoginRequestsession()->regenerate()http_only = trueconfig/session.phpsame_site = laxstrictconfig/session.phpsecure = truenullconfig/session.phplifetimedomain = nullEncryptCookiesVerifyCsrfToken@csrfvalidateCsrfTokens(except: [...])unserialize($request->input(...))eval($request->input(...))extract($request->all())Http::get($request->input('url'))Not part of the OWASP Top 10 but critical for Laravel applications.
exec()shell_exec()system()passthru()redirect($request->input('url'))mimes:max:Content-Security-PolicyVite::useCspNonce()X-Frame-OptionsX-Content-Type-OptionsStrict-Transport-SecurityReferrer-PolicyPermissions-PolicyOnly run if React + Inertia.js detected in Step 1.
dangerouslySetInnerHTML={{ __html: userInput }}DOMPurify.sanitize()hrefsrcjavascript:eval()new Function()setTimeout(string)https://http://HandleInertiaRequests::share()->only([...])toArray()data-pageX-XSRF-TOKENfetchaxiosauth.userauth.userlocalStoragesessionStorageVITE_*npm audit## 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 auditdangerouslySetInnerHTML| Priority | Category | Impact | Rule File |
|---|---|---|---|
| 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 | |
sec-broken-access-controlsec-cryptographic-failuressec-injection-preventionsec-xss-react-inertiasec-csrf-protectionsec-security-misconfigurationsec-authentication-rate-limitingsec-inertia-data-exposurerules/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.mdAGENTS.md