[go: up one dir, main page]

Bug 971612 (CVE-2014-9767) - VUL-0: CVE-2014-9767: php5: ZipArchive::extractTo allows for directory traversal when creating directories
Summary: VUL-0: CVE-2014-9767: php5: ZipArchive::extractTo allows for directory traver...
Status: RESOLVED FIXED
Alias: CVE-2014-9767
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Deadline: 2016-04-15
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/163494/
Whiteboard: CVSSv2:RedHat:CVE-2014-9767:4.3:(AV:N...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-17 13:53 UTC by Victor Pereira
Modified: 2016-08-01 09:00 UTC (History)
3 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Pereira 2016-03-17 13:53:33 UTC
rh#1260716

Inside php_zip.c there's a function called php_zip_make_relative_path which is used to sanitize the file path when extracting a file/directory from a ZIP. When extracting a file, the sanitized pathname is used, so files are only created inside of the directory where they're being extracted. However, for directories, the unsanitized/user-provided "file" value is used instead of the sanitized "path_cleaned" value. As a result, a directory can be created outside of the directory where a ZIP file is being extracted.

Upstream patch:

http://git.php.net/?p=php-src.git;a=commit;h=f9c2bf73adb2ede0a486b0db466c264f2b27e0bb

References:
https://bugs.php.net/bug.php?id=70350
https://bugzilla.redhat.com/show_bug.cgi?id=1260716
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-9767
http://www.openwall.com/lists/oss-security/2015/09/08/8
http://seclists.org/oss-sec/2016/q1/671
https://bugs.php.net/bug.php?id=67996
Comment 1 Swamp Workflow Management 2016-03-17 23:00:36 UTC
bugbot adjusting priority
Comment 2 Petr Gajdos 2016-03-23 06:57:39 UTC
Tested with 13.2, 11.

Installed packages: php5, php5-zip

$ pwd 
/971612/subdir
$ cat test.php
<?php
$archive = new ZipArchive();
$archive->open('a.zip',ZipArchive::CREATE);
$archive->addEmptyDir("../../down");
$archive->close();

$archive2 = new ZipArchive();
$archive2->open('a.zip');
$archive2->extractTo('.');
$archive2->close();
?>

$ php test.php
$ ls
a.zip  test.php

BEFORE

$ ls /down
$

-> ../../down was created

AFTER

ls /down
ls: cannot access /down: No such file or directory
$ ls down
$

-> down was created
Comment 3 Bernhard Wiedemann 2016-03-30 08:00:30 UTC
This is an autogenerated message for OBS integration:
This bug (971612) was mentioned in
https://build.opensuse.org/request/show/381468 13.2 / php5
Comment 5 Petr Gajdos 2016-03-30 08:01:21 UTC
Submitted.
Comment 6 Bernhard Wiedemann 2016-04-01 10:00:29 UTC
This is an autogenerated message for OBS integration:
This bug (971612) was mentioned in
https://build.opensuse.org/request/show/382845 13.2 / php5
Comment 8 Bernhard Wiedemann 2016-04-05 09:00:26 UTC
This is an autogenerated message for OBS integration:
This bug (971612) was mentioned in
https://build.opensuse.org/request/show/384375 13.2 / php5
Comment 10 Bernhard Wiedemann 2016-04-07 13:00:31 UTC
This is an autogenerated message for OBS integration:
This bug (971612) was mentioned in
https://build.opensuse.org/request/show/385728 13.2 / php5
Comment 12 Swamp Workflow Management 2016-04-08 10:00:46 UTC
An update workflow for this issue was started.
This issue was rated as important.
Please submit fixed packages until 2016-04-15.
When done, reassign the bug to security-team@suse.de.
https://swamp.suse.de/webswamp/wf/62611
Comment 13 Bernhard Wiedemann 2016-04-14 14:00:20 UTC
This is an autogenerated message for OBS integration:
This bug (971612) was mentioned in
https://build.opensuse.org/request/show/389948 13.2 / php5
Comment 15 Swamp Workflow Management 2016-04-25 17:08:56 UTC
SUSE-SU-2016:1145-1: An update that fixes 8 vulnerabilities is now available.

Category: security (important)
Bug References: 949961,968284,969821,971611,971612,971912,973351,973792
CVE References: CVE-2014-9767,CVE-2015-7803,CVE-2015-8835,CVE-2015-8838,CVE-2016-2554,CVE-2016-3141,CVE-2016-3142,CVE-2016-3185
Sources used:
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    php53-5.3.17-59.1
SUSE Linux Enterprise Server 11-SP4 (src):    php53-5.3.17-59.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    php53-5.3.17-59.1
Comment 16 Andreas Stieger 2016-04-27 14:49:19 UTC
releasing SLE 12
Comment 17 Swamp Workflow Management 2016-04-27 18:08:45 UTC
SUSE-SU-2016:1166-1: An update that fixes 7 vulnerabilities is now available.

Category: security (important)
Bug References: 968284,969821,971611,971612,971912,973351,973792
CVE References: CVE-2014-9767,CVE-2015-8835,CVE-2015-8838,CVE-2016-2554,CVE-2016-3141,CVE-2016-3142,CVE-2016-3185
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP1 (src):    php5-5.5.14-53.1
SUSE Linux Enterprise Software Development Kit 12 (src):    php5-5.5.14-53.1
SUSE Linux Enterprise Module for Web Scripting 12 (src):    php5-5.5.14-53.1
Comment 18 Swamp Workflow Management 2016-04-27 21:08:07 UTC
openSUSE-SU-2016:1167-1: An update that solves 6 vulnerabilities and has one errata is now available.

Category: security (important)
Bug References: 969821,971611,971612,971912,973351,973792,974305
CVE References: CVE-2014-9767,CVE-2015-8835,CVE-2015-8838,CVE-2016-3141,CVE-2016-3142,CVE-2016-3185
Sources used:
openSUSE 13.2 (src):    php5-5.6.1-53.3
Comment 19 Andreas Stieger 2016-04-28 13:58:54 UTC
Releasing for openSUSE Leap 42.1, all done.
Comment 23 Swamp Workflow Management 2016-04-28 17:08:00 UTC
openSUSE-SU-2016:1173-1: An update that fixes 7 vulnerabilities is now available.

Category: security (important)
Bug References: 968284,969821,971611,971612,971912,973351,973792
CVE References: CVE-2014-9767,CVE-2015-8835,CVE-2015-8838,CVE-2016-2554,CVE-2016-3141,CVE-2016-3142,CVE-2016-3185
Sources used:
openSUSE Leap 42.1 (src):    php5-5.5.14-44.1
Comment 28 Swamp Workflow Management 2016-06-14 18:08:55 UTC
SUSE-SU-2016:1581-1: An update that fixes 31 vulnerabilities is now available.

Category: security (important)
Bug References: 949961,968284,969821,971611,971612,971912,973351,973792,976996,976997,977003,977005,977991,977994,978827,978828,978829,978830,980366,980373,980375,981050,982010,982011,982012,982013,982162
CVE References: CVE-2014-9767,CVE-2015-4116,CVE-2015-7803,CVE-2015-8835,CVE-2015-8838,CVE-2015-8866,CVE-2015-8867,CVE-2015-8873,CVE-2015-8874,CVE-2015-8879,CVE-2016-2554,CVE-2016-3141,CVE-2016-3142,CVE-2016-3185,CVE-2016-4070,CVE-2016-4073,CVE-2016-4342,CVE-2016-4346,CVE-2016-4537,CVE-2016-4538,CVE-2016-4539,CVE-2016-4540,CVE-2016-4541,CVE-2016-4542,CVE-2016-4543,CVE-2016-4544,CVE-2016-5093,CVE-2016-5094,CVE-2016-5095,CVE-2016-5096,CVE-2016-5114
Sources used:
SUSE OpenStack Cloud 5 (src):    php53-5.3.17-71.1
SUSE Manager Proxy 2.1 (src):    php53-5.3.17-71.1
SUSE Manager 2.1 (src):    php53-5.3.17-71.1
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    php53-5.3.17-71.1
SUSE Linux Enterprise Server 11-SP4 (src):    php53-5.3.17-71.1
SUSE Linux Enterprise Server 11-SP3-LTSS (src):    php53-5.3.17-71.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    php53-5.3.17-71.1
SUSE Linux Enterprise Debuginfo 11-SP3 (src):    php53-5.3.17-71.1
Comment 29 Swamp Workflow Management 2016-06-21 11:17:57 UTC
SUSE-SU-2016:1638-1: An update that fixes 85 vulnerabilities is now available.

Category: security (important)
Bug References: 884986,884987,884989,884990,884991,884992,885961,886059,886060,893849,893853,902357,902360,902368,910659,914690,917150,918768,919080,921950,922451,922452,923945,924972,925109,928506,928511,931421,931769,931772,931776,933227,935074,935224,935226,935227,935229,935232,935234,935274,935275,938719,938721,942291,942296,945412,945428,949961,968284,969821,971611,971612,971912,973351,973792,976996,976997,977003,977005,977991,977994,978827,978828,978829,978830,980366,980373,980375,981050,982010,982011,982012,982013,982162
CVE References: CVE-2004-1019,CVE-2006-7243,CVE-2014-0207,CVE-2014-3478,CVE-2014-3479,CVE-2014-3480,CVE-2014-3487,CVE-2014-3515,CVE-2014-3597,CVE-2014-3668,CVE-2014-3669,CVE-2014-3670,CVE-2014-4049,CVE-2014-4670,CVE-2014-4698,CVE-2014-4721,CVE-2014-5459,CVE-2014-8142,CVE-2014-9652,CVE-2014-9705,CVE-2014-9709,CVE-2014-9767,CVE-2015-0231,CVE-2015-0232,CVE-2015-0273,CVE-2015-1352,CVE-2015-2301,CVE-2015-2305,CVE-2015-2783,CVE-2015-2787,CVE-2015-3152,CVE-2015-3329,CVE-2015-3411,CVE-2015-3412,CVE-2015-4021,CVE-2015-4022,CVE-2015-4024,CVE-2015-4026,CVE-2015-4116,CVE-2015-4148,CVE-2015-4598,CVE-2015-4599,CVE-2015-4600,CVE-2015-4601,CVE-2015-4602,CVE-2015-4603,CVE-2015-4643,CVE-2015-4644,CVE-2015-5161,CVE-2015-5589,CVE-2015-5590,CVE-2015-6831,CVE-2015-6833,CVE-2015-6836,CVE-2015-6837,CVE-2015-6838,CVE-2015-7803,CVE-2015-8835,CVE-2015-8838,CVE-2015-8866,CVE-2015-8867,CVE-2015-8873,CVE-2015-8874,CVE-2015-8879,CVE-2016-2554,CVE-2016-3141,CVE-2016-3142,CVE-2016-3185,CVE-2016-4070,CVE-2016-4073,CVE-2016-4342,CVE-2016-4346,CVE-2016-4537,CVE-2016-4538,CVE-2016-4539,CVE-2016-4540,CVE-2016-4541,CVE-2016-4542,CVE-2016-4543,CVE-2016-4544,CVE-2016-5093,CVE-2016-5094,CVE-2016-5095,CVE-2016-5096,CVE-2016-5114
Sources used:
SUSE Linux Enterprise Server 11-SP2-LTSS (src):    php53-5.3.17-47.1
Comment 30 Marcus Meissner 2016-08-01 09:00:18 UTC
all released