Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions ext/standard/tests/strings/bug72434.phpt

This file was deleted.

1 change: 1 addition & 0 deletions ext/zip/php_zip.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function zip_entry_filesize($zip_entry): int|false {}
#[\Deprecated(since: '8.0', message: 'use ZipArchive::statIndex() instead')]
function zip_entry_compressionmethod($zip_entry): string|false {}

/** @not-serializable */
class ZipArchive implements Countable
{
/**
Expand Down
4 changes: 2 additions & 2 deletions ext/zip/php_zip_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions ext/zip/tests/bug72434.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
Bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
--EXTENSIONS--
zip
--FILE--
<?php
$free_me = array(new StdClass());
$serialized_payload = 'a:3:{i:1;N;i:2;O:10:"ZipArchive":1:{s:8:"filename";'.serialize($free_me).'}i:1;R:4;}';
try {
$unserialized_payload = unserialize($serialized_payload);
var_dump($unserialized_payload);
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
Unserialization of 'ZipArchive' is not allowed
16 changes: 16 additions & 0 deletions ext/zip/tests/gh21682.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
GH-21682 (ZipArchive is missing the NOT_SERIALIZABLE flag)
--EXTENSIONS--
zip
--FILE--
<?php
$a = new ZipArchive();
try {
serialize($a);
echo "ERROR: should have thrown\n";
} catch (\Exception $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
Serialization of 'ZipArchive' is not allowed
Loading