Skip to content

MIR0814

TaintedUnserialize

User-controlled input reaches the payload of unserialize(), letting an attacker instantiate classes and trigger their magic methods (PHP object injection).

<?php
$prefs = unserialize($_COOKIE['prefs']); // TaintedUnserialize

Use json_decode() for untrusted data, or pass ['allowed_classes' => false].