PHP-010 / Advanced
Passing user input to unserialize()
Why is this a problem?
Object injection can execute gadget chains through magic methods (__destruct, __wakeup) and lead to RCE.
How to fix it
php
$data = json_decode(base64_decode($request->cookie('prefs')), true, 512, JSON_THROW_ON_ERROR);
// Use only signed cookies or encrypted values (Laravel's default EncryptCookies)