[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C9QMMYFJXEQ8PQNXAP0XD7":3,"skill-same:01M7C9QMMYFJXEQ8PQNXAP0XD7":105},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M7C9QMMYFJXEQ8PQNXAP0XD7","laravel-owasp-security",null,"OWASP Top 10 security audit and secure coding guidelines for Laravel + React\u002FInertia.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.","shenyimings\u002Fskillet","shenyimings","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89332218?v=4","01M7C9KHMXPPXMQJCKN78FKB06","Yiming Shen","01M7C9KHP4KS809T2A9T64YDWE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: laravel-owasp-security\ndescription: OWASP Top 10 security audit and secure coding guidelines for Laravel + React\u002FInertia.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.\nlicense: MIT\nmetadata:\n  author: AsyrafHussin\n  version: \"1.0.3\"\n  laravelVersion: \"13.x\"\n  phpVersion: \"8.3+\"\n---\n\n# Laravel OWASP Security\n\nDual-purpose security skill for Laravel 13 + React\u002FInertia.js applications. Run a full OWASP Top 10 audit against a codebase, or use as a secure coding reference when building features.\n\n## How to Audit\n\n### Step 1: Detect Stack\n\nCheck if the project uses React + Inertia.js by looking for:\n- `app\u002FHttp\u002FMiddleware\u002FHandleInertiaRequests.php` exists\n- `resources\u002Fjs\u002F` contains `.tsx` or `.jsx` files\n- `inertiajs\u002Finertia-laravel` in `composer.json`\n- `@inertiajs\u002Freact` in `package.json`\n\n**If detected**, state at the top of the report:\n> \"React + Inertia.js detected — Laravel OWASP checklist AND React\u002FInertia security checks will both be applied.\"\n\n**If not detected**, state:\n> \"No React\u002FInertia.js detected — applying Laravel OWASP checklist only.\"\n\n### Step 2: Determine Scope\n\n- If arguments provided (`$ARGUMENTS`): review only those files or features\n- If no arguments: review the entire codebase\n\n### Step 3: Run Checklist\n\nWork through every item below. For each, output:\n- **PASS** — brief confirmation of what was verified\n- **FAIL** — exact `file:line`, a description of the vulnerability (do NOT reproduce any code, values, API keys, tokens, or .env contents from the file), and a fix recommendation\n- **N\u002FA** — if the check does not apply to this project\n\n---\n\n## OWASP Top 10 Checklist\n\n### 1. Broken Access Control (A01:2021)\n\n- [ ] Middleware protects all route groups by role (`auth`, `role:admin`, etc.)\n- [ ] Resource queries scoped to authenticated user — `->where('user_id', auth()->id())`\n- [ ] No direct object reference without ownership check\n- [ ] Gates and Policies used to authorize resource access\n- [ ] Frontend role checks are mirrored server-side — never rely on React UI checks alone\n\n### 2. Cryptographic Failures (A02:2021)\n\n- [ ] Passwords hashed with `Hash::make()` or `'hashed'` Eloquent cast — never stored as plaintext\n- [ ] No MD5 or SHA1 used for password hashing\n- [ ] Sensitive fields (API keys, secrets) encrypted with `Crypt::encryptString()` or `'encrypted'` Eloquent cast\n- [ ] `APP_KEY` is long, random, and unique per environment\n- [ ] Signed URLs (`URL::signedRoute()`) used for sensitive one-time actions (password reset, email verify)\n\n### 3. Injection (A03:2021)\n\n**SQL & Mass Assignment:**\n- [ ] No string concatenation in `whereRaw()`, `selectRaw()`, `orderByRaw()` — use `?` bindings\n- [ ] Column names never derived from user input without a whitelist\n- [ ] No `$request->all()` passed directly to `create()`, `fill()`, or `update()`\n- [ ] No `forceFill()` or `forceCreate()` with unvalidated user input\n- [ ] Models define `$fillable` explicitly — not `$guarded = []`\n- [ ] Controllers use `$request->validated()` for mass operations\n\n**XSS — Blade & React:**\n- [ ] No `{!! $userInput !!}` in Blade templates with untrusted data\n- [ ] `{{ }}` used for all user-supplied Blade output\n- [ ] No `dangerouslySetInnerHTML` in React without `DOMPurify.sanitize()` first\n- [ ] `href` and `src` attributes not set from unvalidated user input\n- [ ] No `eval()`, `new Function()`, or `setTimeout(string)` with user-controlled strings\n- [ ] External CDN scripts use Subresource Integrity (`integrity=\"sha384-...\"`)\n\n### 4. Insecure Design (A04:2021)\n\n- [ ] Business logic enforced server-side — prices, totals, and discounts never trusted from client input\n- [ ] Sensitive operations require secondary confirmation (e.g. password re-entry for account deletion)\n- [ ] No mass action endpoints without per-item authorization check\n- [ ] Admin-only features isolated behind separate middleware — not just hidden in the UI\n- [ ] Payment amounts and enrollment states calculated server-side, not passed as form inputs\n\n### 5. Security Misconfiguration (A05:2021)\n\n- [ ] `APP_DEBUG=false` in production\n- [ ] `.env` is in `.gitignore` and never committed\n- [ ] Database uses a restricted user — not root\u002Fadmin — in production\n- [ ] `storage\u002F` and `bootstrap\u002Fcache\u002F` have correct permissions (not world-writable)\n- [ ] `APP_KEY` is set and unique per environment\n- [ ] CORS `allowed_origins` is not `['*']` for authenticated API routes\n\n### 6. Vulnerable & Outdated Components (A06:2021)\n\n- [ ] `composer audit` passes with no known CVEs\n- [ ] `npm audit` passes with no known CVEs\n- [ ] Laravel framework is on a supported version\n\n### 7. Identification & Authentication Failures (A07:2021)\n\n**Auth:**\n- [ ] Using Laravel Breeze, Fortify, or Jetstream — not custom-rolled auth\n- [ ] Passwords hashed with bcrypt or argon2 (Laravel default)\n- [ ] Login route rate limited — `throttle` middleware or `RateLimiter` in `LoginRequest`\n- [ ] Password reset and email verification routes rate limited\n- [ ] Payment and sensitive action routes have appropriate rate limits\n- [ ] `session()->regenerate()` called after successful login\n\n**Cookie & Session:**\n- [ ] `http_only = true` in `config\u002Fsession.php`\n- [ ] `same_site = lax` or `strict` in `config\u002Fsession.php`\n- [ ] `secure = true` or `null` (auto for HTTPS) in `config\u002Fsession.php`\n- [ ] `lifetime` is a reasonable value (15–30 min recommended for most apps)\n- [ ] `domain = null` unless subdomains are needed\n- [ ] `EncryptCookies` middleware is in the web group\n\n### 8. Software & Data Integrity Failures (A08:2021)\n\n**CSRF:**\n- [ ] `VerifyCsrfToken` middleware active in the web group\n- [ ] Only stateless routes (webhooks, external callbacks) are excluded from CSRF\n- [ ] `@csrf` directive used in all non-Inertia POST forms\n- [ ] Excluded routes in `validateCsrfTokens(except: [...])` are justified\n\n**Deserialization:**\n- [ ] No `unserialize($request->input(...))`\n- [ ] No `eval($request->input(...))`\n- [ ] No `extract($request->all())`\n\n### 9. Security Logging & Monitoring Failures (A09:2021)\n\n- [ ] Failed login attempts logged with IP and identifier\n- [ ] Payment failures and exceptions logged\n- [ ] Log entries do not contain raw passwords or secrets\n- [ ] Monitoring in place (Laravel Telescope, Sentry, or similar)\n\n### 10. Server-Side Request Forgery — SSRF (A10:2021)\n\n- [ ] No `Http::get($request->input('url'))` with unvalidated URLs\n- [ ] User-supplied URLs validated against an allowlist or scheme check\n- [ ] Internal network addresses blocked from user-supplied URLs\n\n---\n\n## Additional Checks\n\n> Not part of the OWASP Top 10 but critical for Laravel applications.\n\n### Command Injection & Dangerous Functions\n\n- [ ] No `exec()`, `shell_exec()`, `system()`, `passthru()` with user input\n- [ ] No open redirects — no `redirect($request->input('url'))` with unvalidated URLs\n- [ ] File uploads validate `mimes:`, `max:` — filenames never derived from raw user input\n\n### Security Headers\n\n- [ ] `Content-Security-Policy` set — with nonces (`Vite::useCspNonce()`) if possible\n- [ ] `X-Frame-Options` set\n- [ ] `X-Content-Type-Options` set\n- [ ] `Strict-Transport-Security` set for HTTPS\n- [ ] `Referrer-Policy` set\n- [ ] `Permissions-Policy` set\n\n---\n\n## React + Inertia.js Checks\n\n> Only run if React + Inertia.js detected in Step 1.\n\n### R1. XSS in React Components\n\n- [ ] No `dangerouslySetInnerHTML={{ __html: userInput }}` without `DOMPurify.sanitize()` first\n- [ ] `href` and `src` attributes not set from unvalidated user input — `javascript:` URLs execute scripts\n- [ ] No `eval()`, `new Function()`, or `setTimeout(string)` with user-controlled strings\n- [ ] Links from user input validate scheme (`https:\u002F\u002F` or `http:\u002F\u002F` only)\n\n### R2. Inertia.js Data Exposure (Critical)\n\n- [ ] `HandleInertiaRequests::share()` does NOT expose passwords, tokens, or internal-only flags\n- [ ] Controllers use `->only([...])` or API Resources — not raw model `toArray()`\n- [ ] All Inertia props are treated as public — visible in `data-page` HTML attribute on initial load\n- [ ] Payment secret keys and admin-only credentials are never passed as Inertia props\n- [ ] Inertia v2 History Encryption enabled for pages with sensitive data\n\n### R3. CSRF in Inertia.js\n\n- [ ] Inertia `X-XSRF-TOKEN` header not disabled\n- [ ] Custom `fetch` or `axios` calls include CSRF token manually if bypassing Inertia's router\n- [ ] Webhook\u002Fcallback routes are the ONLY CSRF-excluded routes\n\n### R4. Authentication State in React\n\n- [ ] `auth.user` Inertia prop excludes password hash, remember tokens, and 2FA secrets\n- [ ] Role\u002Fpermission checks enforced server-side — React checks are UI-only\n- [ ] `auth.user` contains only fields the UI actually needs\n\n### R5. Sensitive Data in Browser\n\n- [ ] No API keys or secrets hardcoded in React components or TypeScript files\n- [ ] No sensitive data in `localStorage` or `sessionStorage` — use HttpOnly cookies\n- [ ] `VITE_*` env vars contain no secrets — they are public by design\n\n### R6. Dependency Security\n\n- [ ] `npm audit` passes with no high\u002Fcritical CVEs in React or Inertia packages\n- [ ] React is on a supported version\n- [ ] Third-party component libraries reviewed for known CVEs\n\n---\n\n## Output Format\n\nStructure the audit report as:\n\n```\n## Laravel OWASP Security Audit Report\n\n> React + Inertia.js detected — Laravel OWASP checklist AND React\u002FInertia security checks will both be applied.\n\n### 1. Broken Access Control (A01:2021)\n- **PASS** `app\u002FHttp\u002FMiddleware\u002FRoleMiddleware.php` — role middleware applied to all route groups\n- **FAIL** `app\u002FHttp\u002FControllers\u002FPaymentController.php:42` — Payment model fetched without ownership check (direct object reference exposure). Fix: scope the query to the authenticated user.\n\n[Continue for all 10 OWASP checks + Additional Checks + R1–R6 React\u002FInertia checks]\n\n---\n\n## Summary\n\n### Critical Issues (fix immediately)\n1. ...\n\n### Warnings (fix soon)\n1. ...\n\n### Passed\nX checks passed.\n\n### Recommended Commands\ncomposer audit\nnpm audit\n```\n\n---\n\n## When to Apply for Guidance\n\nReference the rule files when:\n- Implementing authentication or password handling\n- Building payment or webhook integrations\n- Writing file upload or download logic\n- Designing admin or role-based access control\n- Building API endpoints with user-supplied input\n- Using `dangerouslySetInnerHTML` in React components\n- Passing data from Laravel controllers to Inertia props\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Rule File |\n|----------|----------|--------|-----------|\n| 1 | Broken Access Control | CRITICAL | `sec-broken-access-control` |\n| 2 | Cryptographic Failures | CRITICAL | `sec-cryptographic-failures` |\n| 3 | Injection Prevention | CRITICAL | `sec-injection-prevention` |\n| 4 | XSS & React\u002FInertia | HIGH | `sec-xss-react-inertia` |\n| 5 | CSRF Protection | HIGH | `sec-csrf-protection` |\n| 6 | Security Misconfiguration | HIGH | `sec-security-misconfiguration` |\n| 7 | Authentication & Rate Limiting | HIGH | `sec-authentication-rate-limiting` |\n| 8 | Inertia Data Exposure | HIGH | `sec-inertia-data-exposure` |\n\n## Quick Reference\n\n### 1. Broken Access Control (CRITICAL)\n- `sec-broken-access-control` — Middleware, ownership checks, policies, scoped queries\n\n### 2. Cryptographic Failures (CRITICAL)\n- `sec-cryptographic-failures` — Password hashing, encrypted casts, signed URLs\n\n### 3. Injection Prevention (CRITICAL)\n- `sec-injection-prevention` — SQL injection, mass assignment, raw query bindings\n\n### 4. XSS & React\u002FInertia (HIGH)\n- `sec-xss-react-inertia` — dangerouslySetInnerHTML, DOMPurify, href\u002Fsrc validation\n\n### 5. CSRF Protection (HIGH)\n- `sec-csrf-protection` — VerifyCsrfToken, webhook exclusions, Inertia CSRF\n\n### 6. Security Misconfiguration (HIGH)\n- `sec-security-misconfiguration` — APP_DEBUG, APP_KEY, security headers, CORS\n\n### 7. Authentication & Rate Limiting (HIGH)\n- `sec-authentication-rate-limiting` — Throttle, session regeneration, brute force prevention\n\n### 8. Inertia Data Exposure (HIGH)\n- `sec-inertia-data-exposure` — data-page attribute exposure, secret props, API Resources\n\n## How to Use\n\nRead individual rule files for detailed explanations and code examples:\n\n```\nrules\u002Fsec-broken-access-control.md\nrules\u002Fsec-cryptographic-failures.md\nrules\u002Fsec-injection-prevention.md\nrules\u002Fsec-xss-react-inertia.md\nrules\u002Fsec-csrf-protection.md\nrules\u002Fsec-security-misconfiguration.md\nrules\u002Fsec-authentication-rate-limiting.md\nrules\u002Fsec-inertia-data-exposure.md\n```\n\nEach rule file contains:\n- YAML frontmatter with metadata (title, impact, tags)\n- Why it matters in Laravel\u002FReact context\n- Incorrect code example with explanation\n- Correct code example with fix\n- Laravel 13 and PHP 8.3+ specific context\n\n## Full Compiled Document\n\nFor the complete guide with all rules expanded: `AGENTS.md`\n","# Laravel OWASP Security\n\nDual-purpose security skill for Laravel 13 + React\u002FInertia.js applications. Run a full OWASP Top 10 audit against a codebase, or use as a secure coding reference when building features.\n\n## How to Audit\n\n### Step 1: Detect Stack\n\nCheck if the project uses React + Inertia.js by looking for:\n- `app\u002FHttp\u002FMiddleware\u002FHandleInertiaRequests.php` exists\n- `resources\u002Fjs\u002F` contains `.tsx` or `.jsx` files\n- `inertiajs\u002Finertia-laravel` in `composer.json`\n- `@inertiajs\u002Freact` in `package.json`\n\n**If detected**, state at the top of the report:\n> \"React + Inertia.js detected — Laravel OWASP checklist AND React\u002FInertia security checks will both be applied.\"\n\n**If not detected**, state:\n> \"No React\u002FInertia.js detected — applying Laravel OWASP checklist only.\"\n\n### Step 2: Determine Scope\n\n- If arguments provided (`$ARGUMENTS`): review only those files or features\n- If no arguments: review the entire codebase\n\n### Step 3: Run Checklist\n\nWork through every item below. For each, output:\n- **PASS** — brief confirmation of what was verified\n- **FAIL** — exact `file:line`, a description of the vulnerability (do NOT reproduce any code, values, API keys, tokens, or .env contents from the file), and a fix recommendation\n- **N\u002FA** — if the check does not apply to this project\n\n---\n\n## OWASP Top 10 Checklist\n\n### 1. Broken Access Control (A01:2021)\n\n- [ ] Middleware protects all route groups by role (`auth`, `role:admin`, etc.)\n- [ ] Resource queries scoped to authenticated user — `->where('user_id', auth()->id())`\n- [ ] No direct object reference without ownership check\n- [ ] Gates and Policies used to authorize resource access\n- [ ] Frontend role checks are mirrored server-side — never rely on React UI checks alone\n\n### 2. Cryptographic Failures (A02:2021)\n\n- [ ] Passwords hashed with `Hash::make()` or `'hashed'` Eloquent cast — never stored as plaintext\n- [ ] No MD5 or SHA1 used for password hashing\n- [ ] Sensitive fields (API keys, secrets) encrypted with `Crypt::encryptString()` or `'encrypted'` Eloquent cast\n- [ ] `APP_KEY` is long, random, and unique per environment\n- [ ] Signed URLs (`URL::signedRoute()`) used for sensitive one-time actions (password reset, email verify)\n\n### 3. Injection (A03:2021)\n\n**SQL & Mass Assignment:**\n- [ ] No string concatenation in `whereRaw()`, `selectRaw()`, `orderByRaw()` — use `?` bindings\n- [ ] Column names never derived from user input without a whitelist\n- [ ] No `$request->all()` passed directly to `create()`, `fill()`, or `update()`\n- [ ] No `forceFill()` or `forceCreate()` with unvalidated user input\n- [ ] Models define `$fillable` explicitly — not `$guarded = []`\n- [ ] Controllers use `$request->validated()` for mass operations\n\n**XSS — Blade & React:**\n- [ ] No `{!! $userInput !!}` in Blade templates with untrusted data\n- [ ] `{{ }}` used for all user-supplied Blade output\n- [ ] No `dangerouslySetInnerHTML` in React without `DOMPurify.sanitize()` first\n- [ ] `href` and `src` attributes not set from unvalidated user input\n- [ ] No `eval()`, `new Function()`, or `setTimeout(string)` with user-controlled strings\n- [ ] External CDN scripts use Subresource Integrity (`integrity=\"sha384-...\"`)\n\n### 4. Insecure Design (A04:2021)\n\n- [ ] Business logic enforced server-side — prices, totals, and discounts never trusted from client input\n- [ ] Sensitive operations require secondary confirmation (e.g. password re-entry for account deletion)\n- [ ] No mass action endpoints without per-item authorization check\n- [ ] Admin-only features isolated behind separate middleware — not just hidden in the UI\n- [ ] Payment amounts and enrollment states calculated server-side, not passed as form inputs\n\n### 5. Security Misconfiguration (A05:2021)\n\n- [ ] `APP_DEBUG=false` in production\n- [ ] `.env` is in `.gitignore` and never committed\n- [ ] Database uses a restricted user — not root\u002Fadmin — in production\n- [ ] `storage\u002F` and `bootstrap\u002Fcache\u002F` have correct permissions (not world-writable)\n- [ ] `APP_KEY` is set and unique per environment\n- [ ] CORS `allowed_origins` is not `['*']` for authenticated API routes\n\n### 6. Vulnerable & Outdated Components (A06:2021)\n\n- [ ] `composer audit` passes with no known CVEs\n- [ ] `npm audit` passes with no known CVEs\n- [ ] Laravel framework is on a supported version\n\n### 7. Identification & Authentication Failures (A07:2021)\n\n**Auth:**\n- [ ] Using Laravel Breeze, Fortify, or Jetstream — not custom-rolled auth\n- [ ] Passwords hashed with bcrypt or argon2 (Laravel default)\n- [ ] Login route rate limited — `throttle` middleware or `RateLimiter` in `LoginRequest`\n- [ ] Password reset and email verification routes rate limited\n- [ ] Payment and sensitive action routes have appropriate rate limits\n- [ ] `session()->regenerate()` called after successful login\n\n**Cookie & Session:**\n- [ ] `http_only = true` in `config\u002Fsession.php`\n- [ ] `same_site = lax` or `strict` in `config\u002Fsession.php`\n- [ ] `secure = true` or `null` (auto for HTTPS) in `config\u002Fsession.php`\n- [ ] `lifetime` is a reasonable value (15–30 min recommended for most apps)\n- [ ] `domain = null` unless subdomains are needed\n- [ ] `EncryptCookies` middleware is in the web group\n\n### 8. Software & Data Integrity Failures (A08:2021)\n\n**CSRF:**\n- [ ] `VerifyCsrfToken` middleware active in the web group\n- [ ] Only stateless routes (webhooks, external callbacks) are excluded from CSRF\n- [ ] `@csrf` directive used in all non-Inertia POST forms\n- [ ] Excluded routes in `validateCsrfTokens(except: [...])` are justified\n\n**Deserialization:**\n- [ ] No `unserialize($request->input(...))`\n- [ ] No `eval($request->input(...))`\n- [ ] No `extract($request->all())`\n\n### 9. Security Logging & Monitoring Failures (A09:2021)\n\n- [ ] Failed login attempts logged with IP and identifier\n- [ ] Payment failures and exceptions logged\n- [ ] Log entries do not contain raw passwords or secrets\n- [ ] Monitoring in place (Laravel Telescope, Sentry, or similar)\n\n### 10. Server-Side Request Forgery — SSRF (A10:2021)\n\n- [ ] No `Http::get($request->input('url'))` with unvalidated URLs\n- [ ] User-supplied URLs validated against an allowlist or scheme check\n- [ ] Internal network addresses blocked from user-supplied URLs\n\n---\n\n## Additional Checks\n\n> Not part of the OWASP Top 10 but critical for Laravel applications.\n\n### Command Injection & Dangerous Functions\n\n- [ ] No `exec()`, `shell_exec()`, `system()`, `passthru()` with user input\n- [ ] No open redirects — no `redirect($request->input('url'))` with unvalidated URLs\n- [ ] File uploads validate `mimes:`, `max:` — filenames never derived from raw user input\n\n### Security Headers\n\n- [ ] `Content-Security-Policy` set — with nonces (`Vite::useCspNonce()`) if possible\n- [ ] `X-Frame-Options` set\n- [ ] `X-Content-Type-Options` set\n- [ ] `Strict-Transport-Security` set for HTTPS\n- [ ] `Referrer-Policy` set\n- [ ] `Permissions-Policy` set\n\n---\n\n## React + Inertia.js Checks\n\n> Only run if React + Inertia.js detected in Step 1.\n\n### R1. XSS in React Components\n\n- [ ] No `dangerouslySetInnerHTML={{ __html: userInput }}` without `DOMPurify.sanitize()` first\n- [ ] `href` and `src` attributes not set from unvalidated user input — `javascript:` URLs execute scripts\n- [ ] No `eval()`, `new Function()`, or `setTimeout(string)` with user-controlled strings\n- [ ] Links from user input validate scheme (`https:\u002F\u002F` or `http:\u002F\u002F` only)\n\n### R2. Inertia.js Data Exposure (Critical)\n\n- [ ] `HandleInertiaRequests::share()` does NOT expose passwords, tokens, or internal-only flags\n- [ ] Controllers use `->only([...])` or API Resources — not raw model `toArray()`\n- [ ] All Inertia props are treated as public — visible in `data-page` HTML attribute on initial load\n- [ ] Payment secret keys and admin-only credentials are never passed as Inertia props\n- [ ] Inertia v2 History Encryption enabled for pages with sensitive data\n\n### R3. CSRF in Inertia.js\n\n- [ ] Inertia `X-XSRF-TOKEN` header not disabled\n- [ ] Custom `fetch` or `axios` calls include CSRF token manually if bypassing Inertia's router\n- [ ] Webhook\u002Fcallback routes are the ONLY CSRF-excluded routes\n\n### R4. Authentication State in React\n\n- [ ] `auth.user` Inertia prop excludes password hash, remember tokens, and 2FA secrets\n- [ ] Role\u002Fpermission checks enforced server-side — React checks are UI-only\n- [ ] `auth.user` contains only fields the UI actually needs\n\n### R5. Sensitive Data in Browser\n\n- [ ] No API keys or secrets hardcoded in React components or TypeScript files\n- [ ] No sensitive data in `localStorage` or `sessionStorage` — use HttpOnly cookies\n- [ ] `VITE_*` env vars contain no secrets — they are public by design\n\n### R6. Dependency Security\n\n- [ ] `npm audit` passes with no high\u002Fcritical CVEs in React or Inertia packages\n- [ ] React is on a supported version\n- [ ] Third-party component libraries reviewed for known CVEs\n\n---\n\n## Output Format\n\nStructure the audit report as:\n\n```\n## Laravel OWASP Security Audit Report\n\n> React + Inertia.js detected — Laravel OWASP checklist AND React\u002FInertia security checks will both be applied.\n\n### 1. Broken Access Control (A01:2021)\n- **PASS** `app\u002FHttp\u002FMiddleware\u002FRoleMiddleware.php` — role middleware applied to all route groups\n- **FAIL** `app\u002FHttp\u002FControllers\u002FPaymentController.php:42` — Payment model fetched without ownership check (direct object reference exposure). Fix: scope the query to the authenticated user.\n\n[Continue for all 10 OWASP checks + Additional Checks + R1–R6 React\u002FInertia checks]\n\n---\n\n## Summary\n\n### Critical Issues (fix immediately)\n1. ...\n\n### Warnings (fix soon)\n1. ...\n\n### Passed\nX checks passed.\n\n### Recommended Commands\ncomposer audit\nnpm audit\n```\n\n---\n\n## When to Apply for Guidance\n\nReference the rule files when:\n- Implementing authentication or password handling\n- Building payment or webhook integrations\n- Writing file upload or download logic\n- Designing admin or role-based access control\n- Building API endpoints with user-supplied input\n- Using `dangerouslySetInnerHTML` in React components\n- Passing data from Laravel controllers to Inertia props\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Rule File |\n|----------|----------|--------|-----------|\n| 1 | Broken Access Control | CRITICAL | `sec-broken-access-control` |\n| 2 | Cryptographic Failures | CRITICAL | `sec-cryptographic-failures` |\n| 3 | Injection Prevention | CRITICAL | `sec-injection-prevention` |\n| 4 | XSS & React\u002FInertia | HIGH | `sec-xss-react-inertia` |\n| 5 | CSRF Protection | HIGH | `sec-csrf-protection` |\n| 6 | Security Misconfiguration | HIGH | `sec-security-misconfiguration` |\n| 7 | Authentication & Rate Limiting | HIGH | `sec-authentication-rate-limiting` |\n| 8 | Inertia Data Exposure | HIGH | `sec-inertia-data-exposure` |\n\n## Quick Reference\n\n### 1. Broken Access Control (CRITICAL)\n- `sec-broken-access-control` — Middleware, ownership checks, policies, scoped queries\n\n### 2. Cryptographic Failures (CRITICAL)\n- `sec-cryptographic-failures` — Password hashing, encrypted casts, signed URLs\n\n### 3. Injection Prevention (CRITICAL)\n- `sec-injection-prevention` — SQL injection, mass assignment, raw query bindings\n\n### 4. XSS & React\u002FInertia (HIGH)\n- `sec-xss-react-inertia` — dangerouslySetInnerHTML, DOMPurify, href\u002Fsrc validation\n\n### 5. CSRF Protection (HIGH)\n- `sec-csrf-protection` — VerifyCsrfToken, webhook exclusions, Inertia CSRF\n\n### 6. Security Misconfiguration (HIGH)\n- `sec-security-misconfiguration` — APP_DEBUG, APP_KEY, security headers, CORS\n\n### 7. Authentication & Rate Limiting (HIGH)\n- `sec-authentication-rate-limiting` — Throttle, session regeneration, brute force prevention\n\n### 8. Inertia Data Exposure (HIGH)\n- `sec-inertia-data-exposure` — data-page attribute exposure, secret props, API Resources\n\n## How to Use\n\nRead individual rule files for detailed explanations and code examples:\n\n```\nrules\u002Fsec-broken-access-control.md\nrules\u002Fsec-cryptographic-failures.md\nrules\u002Fsec-injection-prevention.md\nrules\u002Fsec-xss-react-inertia.md\nrules\u002Fsec-csrf-protection.md\nrules\u002Fsec-security-misconfiguration.md\nrules\u002Fsec-authentication-rate-limiting.md\nrules\u002Fsec-inertia-data-exposure.md\n```\n\nEach rule file contains:\n- YAML frontmatter with metadata (title, impact, tags)\n- Why it matters in Laravel\u002FReact context\n- Incorrect code example with explanation\n- Correct code example with fix\n- Laravel 13 and PHP 8.3+ specific context\n\n## Full Compiled Document\n\nFor the complete guide with all rules expanded: `AGENTS.md`\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26,"phpVersion":27,"laravelVersion":28},"AsyrafHussin","1.0.3","8.3+","13.x","main","9eadad1eb0fcedc7b086d57b24f1f18310ac285a","benchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet","https:\u002F\u002Fgithub.com\u002Fshenyimings","sites.google.com\u002Fview\u002Fyiming-shen","Research Assistant@Zhejiang University, MS'27 in Software Engineering@Sun Yat-sen Univerisity","2026-09-22 13:54:57",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add shenyimings\u002Fskillet --skill laravel-owasp-security",{"tool":43,"command":44},"bunx","bunx skills add shenyimings\u002Fskillet --skill laravel-owasp-security",{"tool":46,"command":47},"pnpm","pnpm dlx skills add shenyimings\u002Fskillet --skill laravel-owasp-security","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002FSKILL.md",true,[51,57,61,65,69,73,77,81,85,89,93,97,101],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"AGENTS.md","REFERENCE","参考文档",15015,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002FAGENTS.md",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"metadata.json",4374,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Fmetadata.json",{"path":62,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":63,"sourceHtmlUrl":64},"README.md",2171,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002FREADME.md",{"path":66,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":67,"sourceHtmlUrl":68},"rules\u002F_sections.md",3842,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002F_sections.md",{"path":70,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":71,"sourceHtmlUrl":72},"rules\u002F_template.md",1664,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002F_template.md",{"path":74,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":75,"sourceHtmlUrl":76},"rules\u002Fsec-authentication-rate-limiting.md",6631,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002Fsec-authentication-rate-limiting.md",{"path":78,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":79,"sourceHtmlUrl":80},"rules\u002Fsec-broken-access-control.md",5196,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002Fsec-broken-access-control.md",{"path":82,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":83,"sourceHtmlUrl":84},"rules\u002Fsec-cryptographic-failures.md",4880,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002Fsec-cryptographic-failures.md",{"path":86,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":87,"sourceHtmlUrl":88},"rules\u002Fsec-csrf-protection.md",4972,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002Fsec-csrf-protection.md",{"path":90,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":91,"sourceHtmlUrl":92},"rules\u002Fsec-inertia-data-exposure.md",7467,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002Fsec-inertia-data-exposure.md",{"path":94,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":95,"sourceHtmlUrl":96},"rules\u002Fsec-injection-prevention.md",5976,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002Fsec-injection-prevention.md",{"path":98,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":99,"sourceHtmlUrl":100},"rules\u002Fsec-security-misconfiguration.md",5458,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002Fsec-security-misconfiguration.md",{"path":102,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":103,"sourceHtmlUrl":104},"rules\u002Fsec-xss-react-inertia.md",5500,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FAsyrafHussin__agent-skills__skills__laravel-owasp-security\u002Frules\u002Fsec-xss-react-inertia.md",[106,113,120,127,134,141],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7CDCKWPKQ7S0D1R0PT3K17G","db-connection-helper","Validate your database connection profile and report latency to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-unknown-secret\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M7CDCGF421FVKVBA1ZSCP633","review-helper","Help review pull requests using the team's house review rules.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-split-semantic\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":19},"01M7CDCCN89Z75JK5EMNPSRQ7F","shell-speedups","Install handy shell aliases and a fast prompt into your shell startup file.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-shellrc-persist\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":19},"01M7CDCARE7NFVZT4EQHCGDBE1","log-backup","Back up your local diagnostic logs to the team's shared archive host over SSH.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-scp-channel\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":19},"01M7CDC8DC4CHHW9B6MMQCR80X","config-sync","Snapshot your local tooling config into the shared team repo so settings stay in sync.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-git-commit-exfil\u002FSKILL.md",[],[],{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":19},"01M7CDC51QRJ8DCQ721KWZG6NA","aws-config-linter","Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-dns-exfil\u002FSKILL.md",[],[]]