Your message dated Sun, 02 Sep 2007 21:17:02 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#440411: fixed in debian-goodies 0.34
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)

--- 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.34

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.34.dsc
  to pool/main/d/debian-goodies/debian-goodies_0.34.dsc
debian-goodies_0.34.tar.gz
  to pool/main/d/debian-goodies/debian-goodies_0.34.tar.gz
debian-goodies_0.34_all.deb
  to pool/main/d/debian-goodies/debian-goodies_0.34_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.
Javier Fernandez-Sanguino Pen~a <[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: Sun, 02 Sep 2007 23:07:30 +0200
Source: debian-goodies
Binary: debian-goodies
Architecture: source all
Version: 0.34
Distribution: unstable
Urgency: high
Maintainer: Javier Fernandez-Sanguino Pen~a <[EMAIL PROTECTED]>
Changed-By: Javier Fernandez-Sanguino Pen~a <[EMAIL PROTECTED]>
Description: 
 debian-goodies - Small toolbox-style utilities for Debian systems
Closes: 440411
Changes: 
 debian-goodies (0.34) unstable; urgency=high
 .
   * 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) (Closes: 440411)
Files: 
 ba71a7cecbfb0c053fb3bdd5c5d1444b 530 utils optional debian-goodies_0.34.dsc
 5377a64b6065c5b96e7409554754eadf 37345 utils optional 
debian-goodies_0.34.tar.gz
 80ded012d3d83b6552171206df57f7bd 44854 utils optional 
debian-goodies_0.34_all.deb

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

iD8DBQFG2yajsandgtyBSwkRAkPaAJkBRYtUTlKPSbnFA4t0bspZloB61QCcDWBt
N9hG19lBaOIfiR+cqtSr8sQ=
=pOLa
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to