svn: /phpdoc/en/trunk/reference/yaml/ functions/yaml-parse-file.xml functions/yaml-parse-url.xml functions/yaml-parse.xml ini.xml
| From: | Bryan Davis | Date: | Mon, 18 May 2015 15:20:03 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/yaml/ functions/yaml-parse-file.xml functions/yaml-parse-url.xml functions/yaml-parse.xml ini.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13308@lists.php.net to get a copy of this message | ||
bd808 Mon, 18 May 2015 15:20:03 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=336795
Log:
Document unsafe deserialization and ini setting to disable
Add warnings for yaml_parse* methods that processing untrusted input is
dangerous if !php/object content is included. Processing for !php/object can
be disabled with the new yaml.decode_php ini setting.
Bug: 69617
Bug: https://bugs.php.net/69617 (Assigned) PHP
yaml_parse/yaml_parse_file/yaml_parse_url Unsafe Deserialization
Changed paths:
U phpdoc/en/trunk/reference/yaml/functions/yaml-parse-file.xml
U phpdoc/en/trunk/reference/yaml/functions/yaml-parse-url.xml
U phpdoc/en/trunk/reference/yaml/functions/yaml-parse.xml
U phpdoc/en/trunk/reference/yaml/ini.xml
Modified: phpdoc/en/trunk/reference/yaml/functions/yaml-parse-file.xml
===================================================================
--- phpdoc/en/trunk/reference/yaml/functions/yaml-parse-file.xml 2015-05-18 12:44:56 UTC (rev
336794)
+++ phpdoc/en/trunk/reference/yaml/functions/yaml-parse-file.xml 2015-05-18 15:20:03 UTC (rev
336795)
@@ -76,6 +76,18 @@
</para>
</refsect1>
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <warning>
+ <para>
+ Processing untrusted user input with <function>yaml_parse_file</function>
+ is dangerous if the use of <function>unserialize</function> is enabled for
+ nodes using the <literal>!php/object</literal> tag. This behavior can be
+ disabled by using the <literal>yaml.decode_php</literal> ini setting.
+ </para>
+ </warning>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
Modified: phpdoc/en/trunk/reference/yaml/functions/yaml-parse-url.xml
===================================================================
--- phpdoc/en/trunk/reference/yaml/functions/yaml-parse-url.xml 2015-05-18 12:44:56 UTC (rev 336794)
+++ phpdoc/en/trunk/reference/yaml/functions/yaml-parse-url.xml 2015-05-18 15:20:03 UTC (rev 336795)
@@ -73,12 +73,24 @@
&reftitle.returnvalues;
<para>
Returns the value encoded in <parameter>input</parameter> in appropriate
- PHP type&return.falseforfailure;. If <parameter>pos</parameter> is
<literal>-1</literal> an
- <type>array</type> will be returned with one entry for each document found
- in the stream.
+ PHP type&return.falseforfailure;. If <parameter>pos</parameter> is
+ <literal>-1</literal> an <type>array</type> will be returned with one
entry
+ for each document found in the stream.
</para>
</refsect1>
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <warning>
+ <para>
+ Processing untrusted user input with <function>yaml_parse_url</function>
+ is dangerous if the use of <function>unserialize</function> is enabled for
+ nodes using the <literal>!php/object</literal> tag. This behavior can be
+ disabled by using the <literal>yaml.decode_php</literal> ini setting.
+ </para>
+ </warning>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
Modified: phpdoc/en/trunk/reference/yaml/functions/yaml-parse.xml
===================================================================
--- phpdoc/en/trunk/reference/yaml/functions/yaml-parse.xml 2015-05-18 12:44:56 UTC (rev 336794)
+++ phpdoc/en/trunk/reference/yaml/functions/yaml-parse.xml 2015-05-18 15:20:03 UTC (rev 336795)
@@ -203,6 +203,18 @@
</para>
</refsect1>
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <warning>
+ <para>
+ Processing untrusted user input with <function>yaml_parse</function>
+ is dangerous if the use of <function>unserialize</function> is enabled for
+ nodes using the <literal>!php/object</literal> tag. This behavior can be
+ disabled by using the <literal>yaml.decode_php</literal> ini setting.
+ </para>
+ </warning>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
Modified: phpdoc/en/trunk/reference/yaml/ini.xml
===================================================================
--- phpdoc/en/trunk/reference/yaml/ini.xml 2015-05-18 12:44:56 UTC (rev 336794)
+++ phpdoc/en/trunk/reference/yaml/ini.xml 2015-05-18 15:20:03 UTC (rev 336795)
@@ -24,6 +24,12 @@
<entry><!-- leave empty, this will be filled by an automatic script
--></entry>
</row>
<row>
+ <entry><link
linkend="ini.yaml.decode-php">yaml.decode_php</link></entry>
+ <entry>1</entry>
+ <entry>PHP_INI_ALL</entry>
+ <entry><!-- leave empty, this will be filled by an automatic script
--></entry>
+ </row>
+ <row>
<entry><link
linkend="ini.yaml.decode-timestamp">yaml.decode_timestamp</link></entry>
<entry>0</entry>
<entry>PHP_INI_ALL</entry>
@@ -67,6 +73,17 @@
</para>
</listitem>
</varlistentry>
+ <varlistentry xml:id="ini.yaml.decode-php">
+ <term>
+ <parameter>yaml.decode_php</parameter>
+ <type>boolean</type>
+ </term>
+ <listitem>
+ <para>
+ On by default, but can be set to off to prevent serialized php objects which have the
explicit tag "!php/object" from being unserialized.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry xml:id="ini.yaml.decode-timestamp">
<term>
<parameter>yaml.decode_timestamp</parameter>