A user with only read access can make a read-only endpoint run a destructive database operation on a related table, for example emptying it. They don't need any write permission, and the data loss can't be undone.

Who is affected

Apps on laravel/framework from 12.45.0 up to (not including) 12.68.0, or 13.x before 13.27.0, with endpoints that let clients choose which related records to include in a response. The Laravel advisory says it only happens under specific conditions and doesn't list them.

The fix changes how Laravel's JSON:API resources (JsonApiResource) load the relationships a request asks for. If your app returns those resources, it's the code to check. Releases before 12.45.0 aren't affected.

What to do

Update laravel/framework to 13.27.0 if you're on 13.x, or to 12.68.0 if you're on 12.x.

Reported by KIKOmanasijev.