Skip to content

Commit af10d07

Browse files
authored
1 parent 080aab0 commit af10d07

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pclzip.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,6 +3513,12 @@ public function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_al
35133513
}
35143514
}
35153515

3516+
// Patch for Zip Traversal vulnerability
3517+
if (strpos($p_entry['stored_filename'], '../') !== false || strpos($p_entry['stored_filename'], '..\\') !== false) {
3518+
$p_entry['stored_filename'] = basename($p_entry['stored_filename']);
3519+
$p_entry['filename'] = basename($p_entry['stored_filename']);
3520+
}
3521+
35163522
// ----- Add the path
35173523
if ($p_path != '') {
35183524
$p_entry['filename'] = $p_path . "/" . $p_entry['filename'];

0 commit comments

Comments
 (0)