SecurityTracker.com
    Home    |    View Topics    |    Search    |    Contact Us    |   

SecurityTracker
Archives


 


Category:   Application (Generic)  >   Util-linux Vendors:   Valente, Salvatore et al
(Mandrake Issues Fix) Util-linux Collection of Utilities Contains a File Sharing Flaw and Race Condition That Allows Local Users to Gain Root Privileges
SecurityTracker Alert ID:  1005002
SecurityTracker URL:  http://securitytracker.com/id/1005002
CVE Reference:   CVE-2002-0638   (Links to External Site)
Date:  Aug 9 2002
Impact:   Modification of system information, Root access via local system
Fix Available:  Yes  Vendor Confirmed:  Yes  

Description:   A vulnerability was reported in a shared component of the 'util-linux' collection of utilities for Linux. A local user can gain root access on the system.

It is reported that the 'setpwnam.c' shared component contains a file access and state flaw that affects several of the utilities in the 'util-linux' collection. The vulnerability can reportedly be exploited through the 'chfn' utility, which is apparently configured with set user id (suid) root privileges. The 'chfn' utility is provided to allow users to modify the personal information stored in the /etc/passwd file and, because of that, must have root privileges. The exploit involves modifying /etc/passwd, as described below and (in greater detail) in the Source Message.

In the 'login-utils/setpwanam.c' file, the code opens the '/etc/ptmptmp' file with O_WRONLY|O_CREAT flags and 0644 permissions. This file is then linked to '/etc/ptmp' (the process will exit on failure) and '/etc/ptmptmp' is removed. The file descriptor originally obtained is later used for writing data to create the new '/etc/passwd/' contents using the fputs() function. When writing is completed, '/etc/passwd.OLD' is removed, '/etc/passwd' is linked to '/etc/passwd.OLD', and '/etc/ptmp' is renamed to '/etc/passwd'.

The vulnerability arises when the calling process is terminated abnormally, leaving the '/etc/ptmp'. This effective creates a lock on all calling applications, causing the administrator to have to manually remove the file.

If the calling process (chfn, for example) is stopped by SIGSTOP after the '/etc/ptmptmp' file is linked to '/etc/ptmp' but before '/etc/ptmptmp' is removed, and then the administrator removes the '/etc/ptmp' file, a local user can execute another copy of the calling process (chfn), opening the existing '/etc/ptmptmp' and writing the file successfully. The local user can then restart the original process using SIGCONT (which still has an open file descriptor to '/etc/ptmptmp' [later changed to '/etc/ptmp'], resulting in the file being renamed to '/etc/passwd'.

Certain care must be taken to properly control the contents written to the file (see the Source Message for a detailed description of the necessary steps).

Impact:   A local user may be able to write arbitrary data to the '/etc/passwd' file to gain root privileges on the system.
Solution:   Mandrake has released a fix.

Linux-Mandrake 7.1:
4c5df1947b62460beb8df7592ef35c6e 7.1/RPMS/util-linux-2.10o-6.1mdk.i586.rpm
fa4fd5a20bc4cbca324294e3ed712eb1 7.1/SRPMS/util-linux-2.10o-6.1mdk.src.rpm

Linux-Mandrake 7.2:
69f07cace4649f3d8326ea8866d95e4f 7.2/RPMS/util-linux-2.10o-6.1mdk.i586.rpm
fa4fd5a20bc4cbca324294e3ed712eb1 7.2/SRPMS/util-linux-2.10o-6.1mdk.src.rpm

Mandrake Linux 8.0:
18a2dc6e74636bdf6b7be146dfa3d6cf 8.0/RPMS/util-linux-2.10s-3.2mdk.i586.rpm
dd4a423ddc444a202176b09e5251f6fd 8.0/SRPMS/util-linux-2.10s-3.2mdk.src.rpm

Mandrake Linux 8.0/ppc:
55e49d1ad321c229a8468f11a43b2fb7 ppc/8.0/RPMS/util-linux-2.11h-3.5mdk.ppc.rpm
25c5b47d39f8b1c0147930218ddaecd5 ppc/8.0/SRPMS/util-linux-2.11h-3.5mdk.src.rpm

Mandrake Linux 8.1:
889ba34fcb46d9c2c2f11cf4fa81dd23 8.1/RPMS/util-linux-2.11h-3.5mdk.i586.rpm
25c5b47d39f8b1c0147930218ddaecd5 8.1/SRPMS/util-linux-2.11h-3.5mdk.src.rpm

Mandrake Linux 8.1/ia64:
2405d127006eef10e1d58e23866f0044 ia64/8.1/RPMS/util-linux-2.11h-3.5mdk.ia64.rpm
25c5b47d39f8b1c0147930218ddaecd5 ia64/8.1/SRPMS/util-linux-2.11h-3.5mdk.src.rpm

Mandrake Linux 8.2:
f137a274c2969ca3b893e96902dee893 8.2/RPMS/losetup-2.11n-4.3mdk.i586.rpm
c074a07a7f3c3fd92b0be2ebd02dff93 8.2/RPMS/mount-2.11n-4.3mdk.i586.rpm
420c1537cb8260f984125fd6311dc3d1 8.2/RPMS/util-linux-2.11n-4.3mdk.i586.rpm
240139061f653327735eb46c3009d245 8.2/SRPMS/util-linux-2.11n-4.3mdk.src.rpm

Mandrake Linux 8.2/ppc:
9260b9deba8a1e025e028217f99df3ed ppc/8.2/RPMS/losetup-2.11n-4.3mdk.ppc.rpm
abdbafa149f499409c31969ff081e818 ppc/8.2/RPMS/mount-2.11n-4.3mdk.ppc.rpm
3adff58b4e961fa17c8be1d1224072a2 ppc/8.2/RPMS/util-linux-2.11n-4.3mdk.ppc.rpm
240139061f653327735eb46c3009d245 ppc/8.2/SRPMS/util-linux-2.11n-4.3mdk.src.rpm

Corporate Server 1.0.1:
4c5df1947b62460beb8df7592ef35c6e 1.0.1/RPMS/util-linux-2.10o-6.1mdk.i586.rpm
fa4fd5a20bc4cbca324294e3ed712eb1 1.0.1/SRPMS/util-linux-2.10o-6.1mdk.src.rpm

Single Network Firewall 7.2:
69f07cace4649f3d8326ea8866d95e4f snf7.2/RPMS/util-linux-2.10o-6.1mdk.i586.rpm
fa4fd5a20bc4cbca324294e3ed712eb1 snf7.2/SRPMS/util-linux-2.10o-6.1mdk.src.rpm

Cause:   Access control error, State error
Underlying OS:  Linux (Mandriva/Mandrake)
Underlying OS Comments:  7.1, 7.2, 8.0, 8.1, 8.2, Corporate Server 1.0.1, Single Network Firewall 7.2

Message History:   This archive entry is a follow-up to the message listed below.
Jul 30 2002 Util-linux Collection of Utilities Contains a File Sharing Flaw and Race Condition That Allows Local Users to Gain Root Privileges



 Source Message Contents

Subject:  [Security Announce] MDKSA-2002:047 - util-linux update


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

________________________________________________________________________

                Mandrake Linux Security Update Advisory
________________________________________________________________________

Package name:           util-linux
Advisory ID:            MDKSA-2002:047
Date:                   August 8th, 2002
Affected versions:      7.1, 7.2, 8.0, 8.1, 8.2, Corporate Server 1.0.1,
                        Single Network Firewall 7.2
________________________________________________________________________

Problem Description:

 Michal Zalewski found a vulnerability in the util-linux package with
 the chfn utility.  This utility allows users to modify some information
 in the /etc/passwd file, and is installed setuid root.  Using a
 carefully crafted attack sequence, an attacker can exploit a complex
 file locking and modification race that would allow them to make
 changes to the /etc/passwd file.  To successfully exploit this
 vulnerability and obtain privilege escalation, there is a need for some
 administrator interaction, and the password file must over over 4kb in
 size; the attacker's entry cannot be in the last 4kb of the file.
________________________________________________________________________

References:

  http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2002-0638
  http://www.kb.cert.org/vuls/id/405955
________________________________________________________________________

Updated Packages:

 Linux-Mandrake 7.1:
 4c5df1947b62460beb8df7592ef35c6e  7.1/RPMS/util-linux-2.10o-6.1mdk.i586.rpm
 fa4fd5a20bc4cbca324294e3ed712eb1  7.1/SRPMS/util-linux-2.10o-6.1mdk.src.rpm

 Linux-Mandrake 7.2:
 69f07cace4649f3d8326ea8866d95e4f  7.2/RPMS/util-linux-2.10o-6.1mdk.i586.rpm
 fa4fd5a20bc4cbca324294e3ed712eb1  7.2/SRPMS/util-linux-2.10o-6.1mdk.src.rpm

 Mandrake Linux 8.0:
 18a2dc6e74636bdf6b7be146dfa3d6cf  8.0/RPMS/util-linux-2.10s-3.2mdk.i586.rpm
 dd4a423ddc444a202176b09e5251f6fd  8.0/SRPMS/util-linux-2.10s-3.2mdk.src.rpm

 Mandrake Linux 8.0/ppc:
 55e49d1ad321c229a8468f11a43b2fb7  ppc/8.0/RPMS/util-linux-2.11h-3.5mdk.ppc.rpm
 25c5b47d39f8b1c0147930218ddaecd5  ppc/8.0/SRPMS/util-linux-2.11h-3.5mdk.src.rpm

 Mandrake Linux 8.1:
 889ba34fcb46d9c2c2f11cf4fa81dd23  8.1/RPMS/util-linux-2.11h-3.5mdk.i586.rpm
 25c5b47d39f8b1c0147930218ddaecd5  8.1/SRPMS/util-linux-2.11h-3.5mdk.src.rpm

 Mandrake Linux 8.1/ia64:
 2405d127006eef10e1d58e23866f0044  ia64/8.1/RPMS/util-linux-2.11h-3.5mdk.ia64.rpm
 25c5b47d39f8b1c0147930218ddaecd5  ia64/8.1/SRPMS/util-linux-2.11h-3.5mdk.src.rpm

 Mandrake Linux 8.2:
 f137a274c2969ca3b893e96902dee893  8.2/RPMS/losetup-2.11n-4.3mdk.i586.rpm
 c074a07a7f3c3fd92b0be2ebd02dff93  8.2/RPMS/mount-2.11n-4.3mdk.i586.rpm
 420c1537cb8260f984125fd6311dc3d1  8.2/RPMS/util-linux-2.11n-4.3mdk.i586.rpm
 240139061f653327735eb46c3009d245  8.2/SRPMS/util-linux-2.11n-4.3mdk.src.rpm

 Mandrake Linux 8.2/ppc:
 9260b9deba8a1e025e028217f99df3ed  ppc/8.2/RPMS/losetup-2.11n-4.3mdk.ppc.rpm
 abdbafa149f499409c31969ff081e818  ppc/8.2/RPMS/mount-2.11n-4.3mdk.ppc.rpm
 3adff58b4e961fa17c8be1d1224072a2  ppc/8.2/RPMS/util-linux-2.11n-4.3mdk.ppc.rpm
 240139061f653327735eb46c3009d245  ppc/8.2/SRPMS/util-linux-2.11n-4.3mdk.src.rpm

 Corporate Server 1.0.1:
 4c5df1947b62460beb8df7592ef35c6e  1.0.1/RPMS/util-linux-2.10o-6.1mdk.i586.rpm
 fa4fd5a20bc4cbca324294e3ed712eb1  1.0.1/SRPMS/util-linux-2.10o-6.1mdk.src.rpm

 Single Network Firewall 7.2:
 69f07cace4649f3d8326ea8866d95e4f  snf7.2/RPMS/util-linux-2.10o-6.1mdk.i586.rpm
 fa4fd5a20bc4cbca324294e3ed712eb1  snf7.2/SRPMS/util-linux-2.10o-6.1mdk.src.rpm
________________________________________________________________________

Bug IDs fixed (see https://qa.mandrakesoft.com for more information):

________________________________________________________________________

To upgrade automatically, use MandrakeUpdate.  The verification of md5
checksums and GPG signatures is performed automatically for you.

If you want to upgrade manually, download the updated package from one 
of our FTP server mirrors and upgrade with "rpm -Fvh *.rpm".  A list of
FTP mirrors can be obtained from:

  http://www.mandrakesecure.net/en/ftp.php

Please verify the update prior to upgrading to ensure the integrity of
the downloaded package.  You can do this with the command:

  rpm --checksig <filename>

All packages are signed by MandrakeSoft for security.  You can obtain
the GPG public key of the Mandrake Linux Security Team from:

  https://www.mandrakesecure.net/RPM-GPG-KEYS

Please be aware that sometimes it takes the mirrors a few hours to 
update.

You can view other update advisories for Mandrake Linux at:

  http://www.mandrakesecure.net/en/advisories/

MandrakeSoft has several security-related mailing list services that
anyone can subscribe to.  Information on these lists can be obtained by
visiting:

  http://www.mandrakesecure.net/en/mlist.php

If you want to report vulnerabilities, please contact

  security@linux-mandrake.com
________________________________________________________________________

Type Bits/KeyID     Date       User ID
pub  1024D/22458A98 2000-07-10 Linux Mandrake Security Team
  <security@linux-mandrake.com>


- -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.7 (GNU/Linux)

mQGiBDlp594RBAC2tDozI3ZgQsE7XwxurJCJrX0L5vx7SDByR5GHDdWekGhdiday
L4nfUax+SeR9SCoCgTgPW1xB8vtQc8/sinJlMjp9197a2iKM0FOcPlkpa3HcOdt7
WKJqQhlMrHvRcsivzcgqjH44GBBJIT6sygUF8k0lU6YnMHj5MPc/NGWt8wCg9vKo
P0l5QVAFSsHtqcU9W8cc7wMEAJzQsAlnvPXDBfBLEH6u7ptWFdp0GvbSuG2wRaPl
hynHvRiE01ZvwbJZXsPsKm1z7uVoW+NknKLunWKB5axrNXDHxCYJBzY3jTeFjsqx
PFZkIEAQphLTkeXXelAjQ5u9tEshPswEtMvJvUgNiAfbzHfPYmq8D6x5xOw1IySg
2e/LBACxr2UJYCCB2BZ3p508mAB0RpuLGukq+7UWiOizy+kSskIBg2O7sQkVY/Cs
iyGEo4XvXqZFMY39RBdfm2GY+WB/5NFiTOYJRKjfprP6K1YbtsmctsX8dG+foKsD
LLFs7OuVfaydLQYp1iiN6D+LJDSMPM8/LCWzZsgr9EKJ8NXiyrQ6TGludXggTWFu
ZHJha2UgU2VjdXJpdHkgVGVhbSA8c2VjdXJpdHlAbGludXgtbWFuZHJha2UuY29t
PohWBB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RAgAGBQI5aefvAAoJEJqo
0NAiRYqYid0AoJgeWzXrEdIClBOSW5Q6FzqJJyaqAKC0Y9YI3UFlE4zSIGjcFlLJ
EJGXlA==
=yGlX
- -----END PGP PUBLIC KEY BLOCK-----

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9UwrvmqjQ0CJFipgRAqT7AKCXo4vqIEINKD7WCr2DAmav5eusGACdFhUG
5m1VxW/oTHUh8niFyqB0x/s=
=jTBV
-----END PGP SIGNATURE-----

 
 


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2021, SecurityGlobal.net LLC