svn: /phpdoc/en/trunk/reference/var/functions/ unserialize.xml
| From: | Adam Harvey | Date: | Tue, 06 Nov 2012 01:29:54 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/var/functions/ unserialize.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-10658@lists.php.net to get a copy of this message | ||
aharvey Tue, 06 Nov 2012 01:29:54 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=328244
Log:
Since a lot of the notes on unserialize() are to do with handling user input,
or people telling other people they're wrong for trusting user input at all,
add a warning to clarify that unserialize() should not be used with untrusted
data.
Changed paths:
U phpdoc/en/trunk/reference/var/functions/unserialize.xml
Modified: phpdoc/en/trunk/reference/var/functions/unserialize.xml
===================================================================
--- phpdoc/en/trunk/reference/var/functions/unserialize.xml 2012-11-05 10:41:08 UTC (rev 328243)
+++ phpdoc/en/trunk/reference/var/functions/unserialize.xml 2012-11-06 01:29:54 UTC (rev 328244)
@@ -158,6 +158,16 @@
<constant>E_NOTICE</constant>.
</para>
</warning>
+ <warning>
+ <para>
+ Do not pass untrusted user input to <function>unserialize</function>.
+ 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
+ <function>json_decode</function> and <function>json_encode</function>)
if
+ you need to pass serialized data to the user.
+ </para>
+ </warning>
</refsect1>
<refsect1 role="seealso">