Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 229189 - CVE-2005-2475 TOCTOU issue in unzip
Summary: CVE-2005-2475 TOCTOU issue in unzip
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: unzip
Version: 2.1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact:
Whiteboard: impact=low,public=20050802,reported=2...
Depends On: 164927
TreeView+ depends on / blocked
Reported: 2007-02-19 13:33 UTC by Mark J. Cox
Modified: 2007-11-30 22:06 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-09-05 19:20:29 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Mark J. Cox 2007-02-19 13:33:05 UTC
Split for rhel3/2.1

+++ This bug was initially created as a clone of Bug #164927 +++

This issue was posted to bugtraq by Imran Ghory

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

Comment 1 Josh Bressers 2007-09-05 19:20:29 UTC
This flaw has been rated as having a low severity by the Red Hat Security
Response Team.  More information about this rating can be found here:

The risks associated with fixing this bug are greater than the low severity
security risk. We therefore currently have no plans to fix this flaw in Red Hat
Enterprise Linux 2.1 which is in maintenance mode

If you believe this judgement to be in error, please reopen this bug with an
appropriate comment.

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