-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow symlinks to out-of-path filenames
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
tests writes to out-of-path filenames | ||
--SKIPIF-- | ||
--FILE-- | ||
<?php | ||
require_once dirname(__FILE__) . '/setup.php.inc'; | ||
$tar = new Archive_Tar(dirname(__FILE__) . '/out_of_path_symlink.tar'); | ||
$tar->extract(); | ||
$phpunit->assertErrors(array(array('package' => 'PEAR_Error', 'message' => "Out-of-path file extraction {symlink --> /tmp/}")), 'after 1'); | ||
$phpunit->assertFileNotExists('symlink/whatever-filename', 'Out-of-path filename should not have succeeded'); | ||
echo 'tests done'; | ||
?> | ||
--CLEAN-- | ||
<?php | ||
@unlink("symlink"); | ||
?> | ||
--EXPECT-- | ||
tests done |
Binary file not shown.
cde4605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue fixed by this commit was addressed CVE-2020-36193 according to FriendsOfPHP/security-advisories#525