|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68791 Insecure temp file creation
Submitted: 2015-01-10 17:17 UTC Modified: 2020-03-04 11:11 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: bugreports at internot dot info Assigned: remi (profile)
Status: Closed Package: Zip Related
PHP Version: master-Git-2015-01-10 (Git) OS: Linux Ubuntu 14.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bugreports at internot dot info
New email:
PHP Version: OS:


 [2015-01-10 17:17 UTC] bugreports at internot dot info

In /ext/zip/lib/zip_close.c:

613    if ((tfd=mkstemp(temp)) == -1) {

mkstemp is called, but the umask is not securely set first.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-05 18:44 UTC]
-Status: Open +Status: Analyzed
 [2016-09-05 18:44 UTC]
Actually, this is a libzip issue that has been fixed as of libzip
1.0 (at least)[1], and PHP 7 already has at least libzip 1.0.1.

PHP 5.6, however, still ships with libzip 0.11.2, so the fix needs
to be backported. The respective mkstemp() call is in

[1] <>
[2] <>
 [2020-03-04 11:11 UTC]
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: remi
 [2020-03-04 11:11 UTC]
Closing as 5.x is now EOL, PHP 7.2/7.3 have libzip 1.1.2, and since 7.4, libzip is no more bundled.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Jan 21 09:03:35 2022 UTC