MIR0814
TaintedUnserialize
User-controlled input reaches the payload of unserialize(), letting an attacker instantiate classes and trigger their magic methods (PHP object injection).
Example
Section titled “Example”<?php$prefs = unserialize($_COOKIE['prefs']); // TaintedUnserializeHow to fix
Section titled “How to fix”Use json_decode() for untrusted data, or pass ['allowed_classes' => false].
