4 ms·
To be fair, If your program takes user input and calls unserialize on it then whoever wrote the program is an idiot at best * . > Warning > Do not pass untrus
by noir_lord 12y ago
To be fair, If your program takes user input and calls unserialize on it then whoever wrote the program is an idiot at best * .
> Warning
> 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.
* Unless there is an absolute and specific case where you would need to do this, there might be but I'm struggling to think of one.
- cordite 12y agoOr the program takes user input and evals it, which includes unserialize. This can be the case for admin-web-based smart template editing and such. (bleh)
- feld 12y agoIt's a good thing there's no poorly written PHP in the wild and everyone is really, really good at patching PHP immediately upon update. /s edit: http://blog.ircmaxell.com/2014/12/php-install-statistics.html http://blog.ircmaxell.com/2014/12/php-install-statistics.htm...