Bug 164927 - CVE-2005-2475 TOCTOU issue in unzip
CVE-2005-2475 TOCTOU issue in unzip
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: unzip (Show other bugs)
4.0
All Linux
medium Severity low
: ---
: ---
Assigned To: Ivana Varekova
Ben Levenson
impact=low,public=20050802,reported=2...
: Security
Depends On:
Blocks: 229189
  Show dependency treegraph
 
Reported: 2005-08-02 15:17 EDT by Josh Bressers
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: RHSA-2007-0203
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-01 13:05:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Josh Bressers 2005-08-02 15:17:46 EDT
This issue was posted to bugtraq by Imran Ghory
http://marc.theaimsgroup.com/?l=bugtraq&m=112300046224117&w=2


If a malicious local user has write access to a directory in which a
target user is using unzip to extract a file to then a
TOCTOU bug can be exploited to change the permission of any file
belonging to that user.

On decompressing unzip copies the permissions from the compressed
 file to the uncompressed file. However there is a gap between the
uncompressed file being written (and it's file handler being close)
and the permissions of the file being changed.

During this gap a malicious user can remove the decompressed file and
replace it with a hard-link to another file belonging to the user.
unzip will then change the permissions on the  hard-linked file to be
the same as that of the compressed file.

The vulnerable line of code can be found on line 1160 of the file
unix.c where chmod is used (rather than fchmod). unzip also use's
chmod in a number of other places which may also be vulnerable to
exploitation.
Comment 1 Josh Bressers 2005-08-02 15:18:31 EDT
This issue should also affect RHEL2.1 and RHEL3
Comment 2 Ivana Varekova 2005-08-10 03:32:06 EDT
Patches are in cvs now (rhel4, rhel3, rhel2.1).
Comment 3 RHEL Product and Program Management 2006-08-18 13:29:27 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 11 Ivana Varekova 2007-03-23 11:38:28 EDT
I put this bug to state modified - in the present fix there is a bug which
should be fixed and there is necessary to add bz to changelog. 
Comment 15 Red Hat Bugzilla 2007-05-01 13:05:20 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2007-0203.html

Note You need to log in before you can comment on or make changes to this bug.