Your message dated Sat, 29 Mar 2008 19:52:16 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#440411: fixed in debian-goodies 0.23+sarge1
has caused the Debian Bug report #440411,
regarding checkrestart: arbitrary root-privileged command execution
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 this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
440411: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440411
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: debian-goodies
Version: 0.33
Severity: grave
Tags: security

Hi,

The checkrestart program from debian-goodies (both latest 0.33 and
stable 0.27) allows arbitrary command execution with root privileges.

Example:

 $ cp /bin/sleep "; OWNED"
 $ ./"; OWNED" 1000 &
 $ rm "; OWNED"
 $ sudo checkrestart
 ...
 sh: OWNED: command not found
 ...

Since this program is likely launched as a daily root cron job on some
systems, I think this is a grave security hole.

The cause of the problem is the way "dpkg --search" is spawned
from the main() function:

    ...
    dpkgQuery = 'dpkg --search ' + ' '.join(programs.keys())
    for line in os.popen(dpkgQuery).readlines():
        ...

In my above example, one of the programs.keys() is "; OWNED", and thus
the executed command is "dpkg --search ... ; OWNED ...". 

Fixing this should be as easy as:

 ...
 import subprocess
 ...
    dpkgQuery = ["dpkg", "--search"] + programs.keys()
    dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE)
    for line in dpkgProc.stdout.readlines():
        ...

This way, the command arguments are all well separated, without any
shell interpretation.


PS: sorry for any mistake i may have done in the way i've reported this
bug.  I'm not a Debian user, so i'm not used to your system.  Actually,
i just happened to come accross this "checkrestart" script reading a
gentoo-dev@ post: 
  http://article.gmane.org/gmane.linux.gentoo.devel/51366/

-- 
TGL.


--- End Message ---
--- Begin Message ---
Source: debian-goodies
Source-Version: 0.23+sarge1

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

debian-goodies_0.23+sarge1.dsc
  to pool/main/d/debian-goodies/debian-goodies_0.23+sarge1.dsc
debian-goodies_0.23+sarge1.tar.gz
  to pool/main/d/debian-goodies/debian-goodies_0.23+sarge1.tar.gz
debian-goodies_0.23+sarge1_all.deb
  to pool/main/d/debian-goodies/debian-goodies_0.23+sarge1_all.deb



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

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Thijs Kinkhorst <[EMAIL PROTECTED]> (supplier of updated debian-goodies 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 [EMAIL PROTECTED])


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

Format: 1.7
Date: Mon, 24 Mar 2008 15:13:00 +0100
Source: debian-goodies
Binary: debian-goodies
Architecture: source all
Version: 0.23+sarge1
Distribution: oldstable-security
Urgency: high
Maintainer: Matt Zimmerman <[EMAIL PROTECTED]>
Changed-By: Thijs Kinkhorst <[EMAIL PROTECTED]>
Description: 
 debian-goodies - Small toolbox-style utilities for Debian systems
Closes: 440411
Changes: 
 debian-goodies (0.23+sarge1) oldstable-security; urgency=high
 .
   * Non-maintainer upload by the security team.
   * Fix security bug that enables users to generate files in the
     filesystem with shell metacharacters and have the checkrestart
     script run external code (as root, since the script will only
     run as admin). (CVE-2007-3912, closes: 440411)
Files: 
 37eb124fef7c9897ea41ec861ec740ff 819 utils optional 
debian-goodies_0.23+sarge1.dsc
 e0834e7e962fabc65362a60c73362585 11779 utils optional 
debian-goodies_0.23+sarge1.tar.gz
 c8bc8eab12c7e3f29e53f4172ee837a4 22488 utils optional 
debian-goodies_0.23+sarge1_all.deb

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

iQEVAwUBR+e5Y2z0hbPcukPfAQLBLAgAjN7dJp97Yis19s5xaPKcxKDfFUWD5Fcf
w4RFo1Y9v/A0ra0oP4zQMijI8og2kyMhcYQPDQyaQU5nr4oihjVqb/b5hpYDhe2Y
T0ErjGTHkBdgYJf6+NX3DNmCbvAnhSKkk7hsCP1r0q/PJQW7cVupah8JpesmysE2
+9ULUqWK1iP6sfeGh6OfC7qonj8va2Gq1uYaxbLd8wHgs53qkaiZZjdcTGRTwKUy
DSNwJVGz6KNFeiqFIsYDQz6HPtCMNhP/5UKquF2hvol6UHZXyNy89Feci544fIY9
p7MIE/hzPy30HxzR560rgDaZPHaOvqNpsqx7TdoIhkadNWO9paj2MA==
=pm4Q
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to