lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 13 Apr 2005 20:14:23 +0100
From: Imran Ghory <imranghory@...il.com>
To: bugtraq@...urityfocus.com
Subject: cpio TOCTOU file-permissions vulnerability


[Another compression utility with the same race condition issue as bzip2
 (CAN-2005-0953)  & gzip (CAN-2005-0988) - the file is extracted and
file descriptor closed before the file is chmod'ed]

================================
cpio TOCTOU file-permissions vulnerability
================================

Software: cpio
Version: cpio 2.6
Software URL: <http://www.gnu.org/software/cpio/>
Platform:  Unix, Linux.
Vulnerability type: Time-of-Check-Time-Of-Use
Severity: Low, local user, badly set permissions.

Vulnerable software
====================

cpio 2.6 and previous versions running on unix.

Vulnerability
==============

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

On decompressing cpio copies the permissions from the compressed
cpio 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.
cpio will then change the permissions on the  hard-linked file to be
the same as that of the cpio file.

The vulnerable line of code can be found on line 581 of the file
copyin.c. cpio also use's chmod in a number of other places which may
also be vulnerable to exploitation.

Workaround
========

Ensure that any directory which is being used by cpio to
compress/decompress files is only writeable by the user or
alternatively set the sticky bit on the directory's permissions.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ