[Pkg-alsa-devel] Bug#294128: marked as done (alsa-utils: Concerns due to unsafe /tmp usage in alsaconf)

Debian Bug Tracking System owner@bugs.debian.org
Sun, 20 Feb 2005 08:33:10 -0800

Your message dated Sun, 20 Feb 2005 11:17:03 -0500
with message-id <E1D2tlX-0002Hd-00@newraff.debian.org>
and subject line Bug#294128: fixed in alsa-utils 1.0.8-3
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

Received: (at submit) by bugs.debian.org; 8 Feb 2005 01:20:27 +0000
>From jfs@dat.etsit.upm.es Mon Feb 07 17:20:26 2005
Return-path: <jfs@dat.etsit.upm.es>
Received: from tornado.dat.etsit.upm.es (dat.etsit.upm.es) [] 
	by spohr.debian.org with smtp (Exim 3.35 1 (Debian))
	id 1CyK39-0007ww-00; Mon, 07 Feb 2005 17:20:19 -0800
Received: (qmail 1155 invoked by uid 1013); 8 Feb 2005 01:20:17 -0000
Date: Tue, 8 Feb 2005 02:20:17 +0100
From: Javier =?iso-8859-1?Q?Fern=E1ndez-Sanguino_Pe=F1a?= <jfs@computer.org>
To: submit@bugs.debian.org
Subject: alsa-utils: Concerns due to unsafe /tmp usage in alsaconf
Message-ID: <20050208012017.GA724@dat.etsit.upm.es>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q"
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040907i
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Package: alsa-utils
Version: 1.0.8-1
Priority: important
Tags: security upstream

While doing a security audit review of Debian packages for unsafe usage of=
/tmp I've found this in alsa-utils' alsaconf:

    if [ ! -r $CARDID_DB ]; then
    if [ $use_modinfo_db =3D 1 ]; then
        xecho "Building card database.."
        build_card_db $CARDID_DB

build_card_db is a function in alsaconf that starts like this:

build_card_db () {
    MODDIR=3D/lib/modules/`uname -r`
    echo -n > $1

This code is prone to a race condition since the CARDID_DB file is not=20
created inmediately, but created later on. Since alsaconf can only be used=
by root this means that a rogue local user could have root overwrite any=20
files through a symlink attack by exploiting that race condition. Notice,=
also, that the test for CARDID_DB is [ -r ] when it should really be [ -e ]

I'm not sure how to best fix this (since CARDID_DB seems to be created=20
under /var/tmp so it's not removed after reboots) but it looks like it=20
should, at least, check if the file exists and create it inmediately=20
afterwards. Also, the script should use the 'noclobber' and -e options for=
additional safety.



Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

Version: GnuPG v1.2.4 (GNU/Linux)



Received: (at 294128-close) by bugs.debian.org; 20 Feb 2005 16:23:52 +0000
>From katie@ftp-master.debian.org Sun Feb 20 08:23:52 2005
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1D2ts8-0003yI-00; Sun, 20 Feb 2005 08:23:52 -0800
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
	id 1D2tlX-0002Hd-00; Sun, 20 Feb 2005 11:17:03 -0500
From: Jordi Mallach <jordi@debian.org>
To: 294128-close@bugs.debian.org
X-Katie: $Revision: 1.55 $
Subject: Bug#294128: fixed in alsa-utils 1.0.8-3
Message-Id: <E1D2tlX-0002Hd-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Sun, 20 Feb 2005 11:17:03 -0500
Delivered-To: 294128-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Source: alsa-utils
Source-Version: 1.0.8-3

We believe that the bug you reported is fixed in the latest version of
alsa-utils, which is due to be installed in the Debian FTP archive:

  to pool/main/a/alsa-utils/alsa-utils_1.0.8-3.diff.gz
  to pool/main/a/alsa-utils/alsa-utils_1.0.8-3.dsc
  to pool/main/a/alsa-utils/alsa-utils_1.0.8-3_i386.deb

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 294128@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Jordi Mallach <jordi@debian.org> (supplier of updated alsa-utils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)

Hash: SHA1

Format: 1.7
Date: Sun, 20 Feb 2005 16:38:24 +0100
Source: alsa-utils
Binary: alsa-utils
Architecture: source i386
Version: 1.0.8-3
Distribution: unstable
Urgency: low
Maintainer: Debian ALSA Maintainers <pkg-alsa-devel@lists.alioth.debian.org>
Changed-By: Jordi Mallach <jordi@debian.org>
 alsa-utils - ALSA utilities
Closes: 294128
 alsa-utils (1.0.8-3) unstable; urgency=low
   * Thomas Hood
     - 20_alsaconf_safe_tmp:
       Generate card database temporary file safely and only run in
       "modinfo" mode  (Closes: #294128)
 7058d68480b2eb2f31d43ffc96552364 830 sound optional alsa-utils_1.0.8-3.dsc
 096227268eeffd2c7255ba506eda0b67 13866 sound optional alsa-utils_1.0.8-3.diff.gz
 074e6bc3e6bb1f7631c4b43790989682 145902 sound optional alsa-utils_1.0.8-3_i386.deb

Version: GnuPG v1.4.0 (GNU/Linux)