Skip to content

Commit 2b23224

Browse files
authored
phar: Document changes done in #76774 (#4934)
1 parent 98ee565 commit 2b23224

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

reference/phar/Phar.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,31 @@
172172
Added support for the Unix timestamp extension for Zip-based archives.
173173
</entry>
174174
</row>
175+
<row>
176+
<entry>8.0.0</entry>
177+
<entry>
178+
Meta-data is no longer deserialized upon opening the archive,
179+
but is deferred until <methodname>Phar::getMetadata</methodname>
180+
is called.
181+
</entry>
182+
</row>
175183
</tbody>
176184
</tgroup>
177185
</informaltable>
178186
</section>
187+
188+
<section role="notes">
189+
&reftitle.notes;
190+
<caution>
191+
<simpara>
192+
Prior to PHP 8.0.0, the meta-data was deserialized upon opening the
193+
archive. This could lead to security vulnerabilities.
194+
Starting with PHP 8.0.0, meta-data is only deserialized when calling
195+
<methodname>Phar::getMetadata</methodname>, which has options to restrict
196+
deserialization for security reasons.
197+
</simpara>
198+
</caution>
199+
</section>
179200
</partintro>
180201

181202
&reference.phar.entities.Phar;

reference/phar/Phar/getMetadata.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
Retrieve archive meta-data. Meta-data can be any PHP variable that can be serialized.
1717
</para>
1818

19+
<caution>
20+
<simpara>
21+
Accessing the meta-data will trigger deserialization, which can trigger
22+
the execution of arbitrary PHP code. Do not use this on untrusted phar
23+
archives, or configure the <parameter>unserializeOptions</parameter>
24+
in a secure manner.
25+
</simpara>
26+
</caution>
27+
1928
</refsect1>
2029
<refsect1 role="parameters">
2130
&reftitle.parameters;

0 commit comments

Comments
 (0)