Will It Vibe logoWill It Vibe?
LARAVEL-009Medium severity-8 points

Form missing @csrf for a state-changing method

Part of Security, which counts for 30% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.

What it detects

A <form> posts with method="POST" (or the PUT/PATCH/DELETE method-spoofing convention), but the Blade file has no @csrf directive or csrf_field() call anywhere. Laravel's VerifyCsrfToken middleware rejects the request unless the URI was explicitly excluded, so this is either a broken form or a route that was deliberately, and riskily, excluded from CSRF protection.

Why it matters

Laravel's VerifyCsrfToken middleware rejects any POST, PUT, PATCH, or DELETE request that does not carry a valid CSRF token, by default, on every web route. A form missing @csrf will either fail with a 419 error the moment someone submits it, or, if this route was deliberately excluded from CSRF verification, it is now exposed to cross-site request forgery: another site can trigger this form's action using the victim's logged-in session.

How to fix it

Add @csrf inside the <form> tag, Laravel's Blade directive that outputs the hidden token field. If the route is intentionally excluded from CSRF protection for a specific reason, such as a public webhook, that reason should be documented at the exclusion in VerifyCsrfToken's $except list, not left silent here.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Security checks