Laravel (PHP) · CWE-942
Laravel: Permissive CORS + Credentials (Code Remediation)
Implement fail-closed guards and safe data filters. Prevent reflected Origin headers paired with Access-Control-Allow-Credentials: true. Tailored for Laravel: Authorize every controller action via Policy classes and Eloquent bindings.
Coverage ledger tracking key
surface:laravel::boundary:cors-credential-leak::angle:remediation
ZAP 40040 / 10098 cross-domain misconfig audit
Risk boundary
// Unverified Laravel path (CWE-942 · Code Remediation)
// Handler accepts input without validating $request->user()->id.Hardened guard
// Hardened Laravel (CWE-942 · Code Remediation)
// 1. Authorize every controller action via Policy classes and Eloquent bindings
// 2. Validate origins against an exact static allowlist and never combine wildcard rules with cookies.Verification steps
- 01Seed coverage-ledger.json for every Laravel handler touching Permissive CORS + Credentials.
- 02Trace request parameters through $request->user()->id validation down to the sink.
- 03Verify with paired positive/negative evidence via zap-baseline-passive.