DSA-056-1 man-db -- local file overwrite

Related Vulnerabilities: CVE-2001-1331  

Ethan Benson found a bug in man-db packages as distributed in Debian GNU/Linux 2.2. man-db includes a mandb tool which is used to build an index of the manual pages installed on a system. When the -u or -c option were given on the command-line to tell it to write its database to a different location it failed to properly drop privileges before creating a temporary file. This makes it possible for an attacker to do a standard symlink attack to trick mandb into overwriting any file that is writable by uid man, which includes the man and mandb binaries. This has been fixed in version 2.3.16-3, and we recommend that you upgrade your man-db package immediately. If you use suidmanager you can also use that to make sure man and mandb are not installed suid which protects you from this problem. This can be done with the following commands: suidregister /usr/lib/man-db/man root root 0755 suidregister /usr/lib/man-db/mandb root root 0755 Of course even when using suidmanager an upgrade is still strongly recommended.

Debian Security Advisory

DSA-056-1 man-db -- local file overwrite

Date Reported:
08 May 2001
Affected Packages:
man-db
Vulnerable:
Yes
Security database references:
In the Bugtraq database (at SecurityFocus): BugTraq ID 2720.
In Mitre's CVE dictionary: CVE-2001-1331.
More information:
Ethan Benson found a bug in man-db packages as distributed in Debian GNU/Linux 2.2. man-db includes a mandb tool which is used to build an index of the manual pages installed on a system. When the -u or -c option were given on the command-line to tell it to write its database to a different location it failed to properly drop privileges before creating a temporary file. This makes it possible for an attacker to do a standard symlink attack to trick mandb into overwriting any file that is writable by uid man, which includes the man and mandb binaries.

This has been fixed in version 2.3.16-3, and we recommend that you upgrade your man-db package immediately. If you use suidmanager you can also use that to make sure man and mandb are not installed suid which protects you from this problem. This can be done with the following commands:

  suidregister /usr/lib/man-db/man root root 0755
  suidregister /usr/lib/man-db/mandb root root 0755

Of course even when using suidmanager an upgrade is still strongly recommended.

Fixed in:

Debian GNU/Linux 2.2 (potato)

Source:
http://security.debian.org/dists/stable/updates/main/source/man-db_2.3.16-3.dsc
http://security.debian.org/dists/stable/updates/main/source/man-db_2.3.16-3.tar.gz
Alpha:
http://security.debian.org/dists/stable/updates/main/binary-alpha/man-db_2.3.16-3_alpha.deb
ARM:
http://security.debian.org/dists/stable/updates/main/binary-arm/man-db_2.3.16-3_arm.deb
Intel IA-32:
http://security.debian.org/dists/stable/updates/main/binary-i386/man-db_2.3.16-3_i386.deb
Motorola 680x0:
http://security.debian.org/dists/stable/updates/main/binary-m68k/man-db_2.3.16-3_m68k.deb
PowerPC:
http://security.debian.org/dists/stable/updates/main/binary-powerpc/man-db_2.3.16-3_powerpc.deb
Sun Sparc:
http://security.debian.org/dists/stable/updates/main/binary-sparc/man-db_2.3.16-3_sparc.deb

MD5 checksums of the listed files are available in the original advisory.