Exploit the possiblities

FreeBSD Security Advisory 2001.59

FreeBSD Security Advisory 2001.59
Posted Sep 8, 2001
Authored by The FreeBSD Project | Site freebsd.org

FreeBSD Security Advisory FreeBSD-SA-01:59 - The infrequently used rmuser command exposes the master.passwd file to all users for an instant.

systems | freebsd
MD5 | bf944e595aa1cbdbdb1eb29dd592ff90

FreeBSD Security Advisory 2001.59

Change Mirror Download

FreeBSD-SA-01:59 Security Advisory
FreeBSD, Inc.

Topic: rmuser contains a race condition exposing /etc/master.passwd

Category: core
Module: rmuser
Announced: 2001-09-04
Revised: 2001-09-06
Credits: dynamo@harvard.net
Affects: FreeBSD 4.2-RELEASE, 4.3-RELEASE
FreeBSD 4.3-STABLE prior to the correction date.
Corrected: 2001-08-01 20:26:37 UTC (4.3-STABLE)
2001-09-05 05:24:55 UTC (RELENG_4_3)
FreeBSD only: Yes

0. Revision History

v1.0 2001-09-04 Initial release
v1.1 2001-09-06 Update patch. Update correction times. Update upgrade
package as a result.

I. Background

rmuser is a perl script used to completely remove users from a system.

II. Problem Description

When removing a user from the system with the rmuser utility, the
/etc/master.passwd file and it's corresponding database /etc/spwd.db
must be updated. The rmuser script was incorrectly doing this by
creating a new master.passwd file with an unsafe umask and then using
chmod to set its permissions to 0600. Between the time that the file
was created and the time that its permissions were changed the file is

This is only a minor security vulnerability since the rmuser command
is only used infrequently on most systems, and the attack is highly

All versions of FreeBSD prior to the correction date including FreeBSD
4.3 contain this problem. The base system that will ship with FreeBSD
4.4 does not contain this problem since it was corrected prior to the

III. Impact

For a brief amount of time while running rmuser, a world-readable copy
of /etc/master.passwd is available. A local attacker who reads this
file can extract password hashes from the copy of /etc/master.passwd.
This information could be used by attackers to escalate their
privileges, possibly yielding root privileges on the local system, by
mounting an offline dictionary attack in order to guess the plaintext
passwords of the accounts on the local system.

IV. Workaround

Use the pw(8) utility to remove users instead of rmuser.

- "pw userdel <username>" will only remove the user from
/etc/passwd, /etc/master.passwd and /etc/group
- "pw -r userdel <username>" will also remove the user's home

V. Solution

1) Upgrade your vulnerable system to 4.3-STABLE or the RELENG_4_3
security branch, dated after the respective correction dates. Note
that the initial correction dates did not include complete fixes for
the rmuser utility, and sources dated before the updated correction
date given in this advisory will not work.

2) To patch your present system: download the relevant patch from the
below location, and execute the following commands as root:

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-01:59/rmuser.patch.v1.1
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-01:59/rmuser.patch.v1.1.asc

Verify the detached PGP signature using your PGP utility.

This patch has been verified to apply to FreeBSD 4.2-RELEASE and
4.3-RELEASE. It may or may not apply to older, unsupported releases
of FreeBSD.

# cd /usr/src/usr.sbin/adduser
# patch -p < /path/to/patch
# make depend && make all install

3) FreeBSD 4.3-RELEASE systems:

An experimental upgrade package is available for users who wish to
provide testing and feedback on the binary upgrade process. This
package may be installed on FreeBSD 4.3-RELEASE systems only, and is
intended for use on systems for which source patching is not practical
or convenient.

If you use the upgrade package, feedback (positive or negative) to
security-officer@FreeBSD.org is requested so we can improve the
process for future advisories.

During the installation procedure, backup copies are made of the files
which are replaced by the package. These backup copies will be
reinstalled if the package is removed, reverting the system to a
pre-patched state.

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:59/security-patch-rmuser-01.59.tgz
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:59/security-patch-rmuser-01.59.tgz.asc

Verify the detached PGP signature using your PGP utility.

# pkg_add security-patch-rmuser-01.59.tgz

VI. CVS Revisions

The following $FreeBSD$ CVS revision contain the fixes for this
vulnerability. The $FreeBSD$ revision of installed sources can be
examined using the ident(1) command. These revision IDs are not
updated by applying the patch referenced above.

[FreeBSD 4.3-STABLE]

Revision Path src/usr.sbin/rmuser.perl


Revision Path src/usr.sbin/rmuser.perl

Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security-notifications" in the body of the message


RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

Want To Donate?

Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

February 2018

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Feb 1st
    15 Files
  • 2
    Feb 2nd
    15 Files
  • 3
    Feb 3rd
    15 Files
  • 4
    Feb 4th
    13 Files
  • 5
    Feb 5th
    16 Files
  • 6
    Feb 6th
    15 Files
  • 7
    Feb 7th
    15 Files
  • 8
    Feb 8th
    15 Files
  • 9
    Feb 9th
    18 Files
  • 10
    Feb 10th
    8 Files
  • 11
    Feb 11th
    8 Files
  • 12
    Feb 12th
    17 Files
  • 13
    Feb 13th
    15 Files
  • 14
    Feb 14th
    15 Files
  • 15
    Feb 15th
    17 Files
  • 16
    Feb 16th
    18 Files
  • 17
    Feb 17th
    37 Files
  • 18
    Feb 18th
    2 Files
  • 19
    Feb 19th
    16 Files
  • 20
    Feb 20th
    11 Files
  • 21
    Feb 21st
    3 Files
  • 22
    Feb 22nd
    0 Files
  • 23
    Feb 23rd
    0 Files
  • 24
    Feb 24th
    0 Files
  • 25
    Feb 25th
    0 Files
  • 26
    Feb 26th
    0 Files
  • 27
    Feb 27th
    0 Files
  • 28
    Feb 28th
    0 Files

Top Authors In Last 30 Days

File Tags


packet storm

© 2018 Packet Storm. All rights reserved.

Security Services
Hosting By