Laravel's failure mode is an authorization method that exists and is never invoked. Test by requesting every controller action with a second user's model id and checking whether a policy denies it, then by posting extra fields to see what $fillable accepts.
Where this class of bug actually lives in a Laravel app
- Policies never called.
php artisan make:policygenerates the class; you still have to write$this->authorize('view', $invoice)in the controller, and the action added later usually does not. - Route-model binding.
Route::get('/invoices/{invoice}')resolves any invoice by id before your code runs, so the controller receives another tenant's model. $fillableand$guarded.$guarded = []means every column is mass assignable, which includesis_adminandtenant_id.- Blade escaping bypasses.
{!! $value !!}renders unescaped. One of those around a user-supplied field is stored XSS.
What to try first
- Grep the controllers for
authorize(and list the actions that never call it, then hit those with a low-privilege user. - Change the bound model id in each route to another tenant's and compare with a nonexistent id.
- POST
is_admin=1andtenant_id=<other>to every update endpoint. - Look for
{!! !!}around any field a user can write.
A reproduction you can keep
Route-model binding plus a missing policy is the whole bug. One request proves it:
curl -sS -i https://staging.example.com/invoices/1003 \
-H 'Cookie: laravel_session=***' \
-H 'X-XSRF-TOKEN: ***'
curl -sS -i https://staging.example.com/invoices/99999999 \
-H 'Cookie: laravel_session=***'
# vulnerable: 200 with the invoice, and a 404 for the fake id
# fixed: both 404 with the same pageWhat "fixed" has to look like
Bind through a scoped query — Route::get('/invoices/{invoice}', ...)->scopeBindings() with a tenancy scope on the relationship — so the foreign id fails to resolve and returns 404. The control comparison above is the test.
Where people get this wrong
- Gate::before in a service provider can silently allow every ability for one role, which looks like working authorization.
passwordandremember_tokenin$fillableturn an update route into account takeover.- Laravel's debug page on
APP_DEBUG=trueexposes environment variables in the response.
What Offense does here
Offense runs an agent swarm against your app in a disposable sandbox, keeps the request, the identity and the vulnerable response as evidence, and replays the same attack after the fix so the retest is a control comparison rather than a green check. It does not read your source and it does not patch your code: the finding goes to your coding agent with the reproduction attached. The hosted workspace is invite-only — join the waitlist — and the free dependency audit in /install needs no account.
Questions this page answers
Why does a Laravel policy exist and still not block anything?
Because a policy class does nothing until a controller calls authorize(), a form request calls authorize(), or middleware maps the model to it.
Is route-model binding an authorization check?
No. It resolves the record by id. Whether the caller may see it is a separate decision your code has to make.
Written by Offense Research, reviewed December 2, 2026. Correct something? Email imran@offenseresearch.com.