Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101111 - app-arch/unzip TOCTOU issue (CVE-2005-2475)
Summary: app-arch/unzip TOCTOU issue (CVE-2005-2475)
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Security
URL: http://www.securityfocus.com/archive/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-02 10:40 UTC by Sune Kloppenborg Jeppesen (RETIRED)
Modified: 2006-03-03 11:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-08-02 10:40:35 UTC
Not sure wether this applies to us:  
  
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 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-08-02 10:44:10 UTC
Oh well what a nice bug number, let's close this as invalid and pretend 
nothing happened. 
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2006-03-03 10:40:04 UTC
(In reply to comment #1)
> Oh well what a nice bug number, let's close this as invalid and pretend 
> nothing happened. 

Hm, why? Doesn't look like the issue is fixed. Debian did in DSA 903-1 and issued a regression fix (DSA 903-2)
Comment 3 Tavis Ormandy (RETIRED) gentoo-dev 2006-03-03 11:06:23 UTC
Carlo: we consider this is a ridiculous security issue, highly questionable whether we even consider this a bug, if the maintainer or upstream decides to fix it, that is fine, but we dont consider it worthy of attention from security team.
Comment 4 Carsten Lohrke (RETIRED) gentoo-dev 2006-03-03 11:45:40 UTC
Hm, yes seems reasonable. Just wanted to be sure, this didn't got missed. Sorry for the noise.