Skip to content

Commit

Permalink
Also detect malicious paths on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrook committed Jan 2, 2019
1 parent 63b5f9f commit 932afd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Archive/Tar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1770,10 +1770,10 @@ private function _maliciousFilename($file)
if (strpos($file, 'phar://') === 0) {
return true;
}
if (strpos($file, '/../') !== false) {
if (strpos($file, DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR) !== false) {
return true;
}
if (strpos($file, '../') === 0) {
if (strpos($file, '..' . DIRECTORY_SEPARATOR) === 0) {
return true;
}
return false;
Expand Down

0 comments on commit 932afd4

Please sign in to comment.