This issue happens when untrusted input is unserialized. Doing so is documented as being unsafe:
http://php.net/manual/en/function.unserialize.php
Do not pass untrusted user input to unserialize(). Unserialization can
result in code being loaded and executed due to object instantiation and
autoloading, and a malicious user may be able to exploit this. Use a safe,
standard data interchange format such as JSON (via json_decode() and
json_encode()) if you need to pass serialized data to the user.