|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2021-09-06 14:20 UTC] cmb@php.net
 Description: ------------ This has been reported as comment on a very old commit[1]. TL;DR: it is possible to construct ZIP archives containing files which are placed outside the destination directory given to ZipArchive::extractTo() because the implementation of php_zip_make_relative_path() doesn't properly cater to absolute directories on Windows; a path starting with a slash is not an absolute path on Windows, but rather a relative path pointing to the current volume. I'm not sure whether this qualifies as security issue, but a very similar issue regarding Phar::extractTo() (bug #70019) has been handled as such. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 13:00:01 2025 UTC | 
> virtual_file_ex, if I am not mistaken, should return an absolute > path with drive in the path, not only /... . Not sure; there are some inconsistencies regarding such "shortcuts", I think. Anyway, the behavior is the same for PHP 7.4 (NTS and ZTS) and PHP 5.3.29. And realpath("/") gives C:\ on all these versions.