php.net |  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: 2016-09-05 18:44 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: bugreports at internot dot info Assigned:
Status: Analyzed 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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugreports at internot dot info
New email:
PHP Version: OS:

 

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

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

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

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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-05 18:44 UTC] cmb@php.net
-Status: Open +Status: Analyzed
 [2016-09-05 18:44 UTC] cmb@php.net
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
zip_close.c[2].

[1] <http://hg.nih.at/libzip/rev/d3ac0a768127>
[2] <https://github.com/php/php-src/blob/PHP-5.6.26/ext/zip/lib/zip_close.c#L613>
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 00:01:26 2019 UTC