|
|
Log in / Subscribe / Register

Security

Desktop malware risk gets raised and patched

February 25, 2009

This article was contributed by Bruce Byfield

One of the most common claims about GNU/Linux is that it is supposed to be relatively immune to viruses and malware. However, for the past few weeks, that claim has been more closely scrutinized, thanks to a blog posting by "foobar" entitled "How to write a Linux virus in 5 easy steps." Specifically, the posting gives a high-level explanation of how malware can take advantage of the behavior of application launchers on the GNOME and KDE desktops to infect a user account — and possibly gain root access as well. The result has been endless Internet discussions and coordinated efforts by both GNOME and KDE to minimize the problem.

The method described by foobar depends on social engineering: That is, manipulating users into saving an attachment to their GNOME or KDE desktop, and then into executing it. Ordinarily, foobar points out, a saved email attachment would not have executable permission. However, GNOME and KDE share a common format for desktop launchers (*.desktop), and allows them to run without an executable flag. This exception makes it easy to run a script (foobar suggests Python as a likely language) that will download a piece of malware, especially since a custom icon and name can disguise the nature of the program that the launcher runs. Furthermore, by adding a link in the desktop environment's autostart directory, the malware can then run each time that a user logs into the account.

From the perspective of security architecture, gaining root access is considered the goal of malware. However, foobar emphasizes that the method described can do damage without logging into the root account. Still, foobar suggests that the use of sudo and temporary root logins for graphical administration tools provide a backdoor for gaining root access. According to foobar, all that a piece of malware would need to do is make a local copy of an administration tool, then run the malware referencing the local copy. A user would then enter the root password for the tool, and not notice that the malware command was also receiving root access. Alternatively, the malware could add a similar command to the path definition of the current account. Either way, foobar writes, "there's a good chance that you will get [root access] eventually if you are patient."

These suggestions are not new. LWN pointed out the basic problem nearly three years ago, and the potential vulnerabilities of sudo were pointed out two years ago in an Ubuntu forum. All the same, foobar's post has been widely discussed since it first appeared. Besides the comments below the post, it has been discussed in such places as Linux Today, LWN, Slashdot, the KDE Community Forums, and the Ubuntu Forums.

Much of this discussion is repetitive, and beside the point. For example, some users quibble that foobar is technically referring to a trojan, not a virus at all. Others, like "Felice" below the original post, dismiss foobar's analysis on the grounds that, "There will never be any protection against the user's stupidity." Others, like "friends of the one law" (also beneath the original post) insists that such exploits are less likely on GNU/Linux than on Windows because "The installation and/or maintenance of a basic linux desktop requires a level of knowledge _and_ intellect somewhat more developed than that required for a basic Micro$oft product." All these comments, however, are side issues that do not alter the basic problem in any way, even though they each contain some degree of truth.

Other comments were more to the point. Expanding on a comment by foobar, "Colin" posted beneath the original post with a link to the code snippet that prevents Thunar, the Xfce file manager, from having the same desktop vulnerability. Still others tried to correct foobar's suggested code or variations on the basic method outlined.

Some of the most focused responses appeared as comments to LWN's initial coverage of the story. "drag" suggested using a tool like SELinux to create a security context for downloads to the desktop that flags them as untrusted until they are specifically marked as trusted. The same commenter suggested that downloads should be savable only to a designated directory off the desktop — although, as foobar pointed out in the followup blog post, whether this idea would work is uncertain.

In the last few days, both GNOME and KDE have been taking concrete steps to alleviate the problem, with discussions taking place on the XDG (Free Desktop) list. In a blog post, Michael Pyne proposes a policy that will allow files with a .desktop extension to run if they are owned by root (and therefore part of a standard installation), or installed from "a known location for services, applications, and XDG-compliant applications" (that is, ones that meet the shared Free Desktop standards). A whitelist will track all .desktop files that are permitted to run.

Pyne tells LWN that a major challenge of implementation is getting the white list correct. His first whitelist excluded autostart entries, and discussion raised a number of other cases, such as whether existing .desktop files needed to be updated, and how to handle launchers created from a menu or panel.

My first response was to simply broaden the whitelist to include the KDE install prefixes until I could get all the exceptions figured out. Luckily, David Faure immediately knew what was going on and so he's done a good job at re-restricting the whitelist, with some other kdelibs changes needed to make it happen. Last I heard there was still one user having issues (something to do with symlinks) but so far I've heard no other major complaints.

Another issue raised on the XDG list is whether a header should be added to untrusted .desktop files to prevent them from being run from the command line. While some developers questioned the need, Pyne seems to have decided that the precaution is necessary.

Still another concern is to write a clear dialog window that opens when a user tries to launch a .desktop file that is not whitelisted and is therefore not executable. The language is still being improved, but will probably explain the potential danger and when you should and should not continue to run the program, as well as giving the complete path to the command.

GNOME developer Alexander Larsson, although writing that the issue is "all pretty overblown," is working along similar lines. When the changes are implemented, GNOME will add an executable permission to all existing .desktop files when upgrading — a move that KDE, for now, will not follow. "We thought about it but opted to start with the dialog," Pyne tells LWN. "Some kind of dialog will be required no matter what, and any auto-upgrade we do in KDE would have to be done with the user's permission. We may still do it, but it not set yet."

Another difference in GNOME is that any .desktop files that are executable but not in a system directory will be flagged as "untrusted." To emphasize their status, such files will show a shortcut icon and the real file name, rather than any custom icon and display name for the desktop. Pyne has expressed some interest in this idea to LWN, and briefly speculated about how files might be listed as trusted, but, for now KDE is not following this suggestion.

However, much as in KDE, clicking an untrusted file in GNOME will open a dialog that warns the user about the file's status, and gives the choice of running it anyway, marking it as trusted, or canceling its execution.

In both GNOME and KDE, these changes should appear very shortly. Larsson asked for a string break approval for next month's release of GNOME 2.26 so that his changes, particularly the new dialog, can be included. The request was granted, and Larsson tells LWN, "all the required Gnome changes have now landed in glib and nautilus."

Similarly, Pyne hopes to see his changes backported to KDE 4.2 in a point release, as well as appearing in KDE 4.3. Whether the backports occur, he explains to LWN, depends "on if it's deemed a big enough security risk."

The speed with which these changes are being implemented suggests that both KDE and GNOME are treating the security problem as moderately serious. However, Pyne is careful to warn about the limits of the fixes, telling LWN:

This kind of security is only intended to defend against the type of vulnerability where an email attachment or web link is directly executed (by way of downloading an image and clicking on it, for instance). This doesn't defend against archives with executable .desktop files, just like archives with executable Python scripts have no protection. This also doesn't defend against the user following guided instructions on saving a trojan in a whitelisted directory, just like we can't save users who will type in "sudo rm -rf/" in a terminal because an email told them to. This just brings .desktop files up to normal POSIX levels of executable security, nothing more or less.

In other words, the fixes should minimize the chances of a malware infection of the type describes by foobar, but, as many commenters have pointed out, nothing can completely counter user ignorance, rashness, or plain stupidity. The most that desktop developers can do, short of restricting desktop files to a degree that most users would find unacceptable, is to make users aware of the consequences of their possible actions.

Comments (33 posted)

Brief items

OpenSSH 5.2 released

OpenSSH 5.2 has been released with a focus on bug fixes. In particular, it addresses the plaintext recovery attack described in CPNI-957037 (which LWN covered last November). "This release also adds countermeasures to mitigate CPNI-957037-style attacks against the SSH protocol's use of CBC-mode ciphers. Upon detection of an invalid packet length or Message Authentication Code, ssh/sshd will continue reading up to the maximum supported packet length rather than immediately terminating the connection. This eliminates most of the known differences in behaviour that leaked information about the plaintext of injected data which formed the basis of this attack. We believe that these attacks are rendered infeasible by these changes." Click below for the full release announcement.

Full Story (comments: none)

The Cryptography Olympics : the hash algorithm contest (The H)

"The H" is the new name for heise online and it takes a look at the currently running competition for a next-generation cryptographic hash algorithm. "The impetus for the cryptography competition was provided by the cracking of existing security standards by various researchers. Such attacks serve to probe protection mechanisms and aid their development. Because the world needs reliable protection, the National Institute of Standards and Technology (NIST), part of the U.S. Department of Commerce, issued the call for an international Cryptographic Olympics. The victorious algorithm must [fulfill] the full range of requirements imposed by data processing technology, ranging from sensors the size of a grain of sand, to future high speed data networks."

Comments (none posted)

New vulnerabilities

epiphany: arbitrary code execution

Package(s):epiphany CVE #(s):CVE-2008-5985
Created:February 23, 2009 Updated:March 9, 2009
Description:

From the Mandriva advisory:

Python has a variable called sys.path that contains all paths where Python loads modules by using import scripting procedure. A wrong handling of that variable enables local attackers to execute arbitrary code via Python scripting in the current Epiphany working directory

Alerts:
Gentoo 200903-16 epiphany 2009-03-09
Mandriva MDVSA-2009:048-2 epiphany 2009-02-25
Mandriva MDVSA-2009:048-1 epiphany 2009-02-20
Mandriva MDVSA-2009:048 epiphany 2009-02-20

Comments (none posted)

git: arbitrary code execution

Package(s):git CVE #(s):CVE-2008-5916
Created:February 19, 2009 Updated:March 9, 2009
Description: git has an arbitrary code execution vulnerability. From the vulnerability database entry: gitweb/gitweb.perl in gitweb in Git 1.6.x before 1.6.0.6, 1.5.6.x before 1.5.6.6, 1.5.5.x before 1.5.5.6, 1.5.4.x before 1.5.4.7, and other versions after 1.4.3 allows local repository owners to execute arbitrary commands by modifying the diff.external configuration variable and executing a crafted gitweb query.
Alerts:
Gentoo 200903-15 git 2009-03-09
Ubuntu USN-723-1 git-core 2009-02-18

Comments (none posted)

kernel: various issues

Package(s):kernel CVE #(s):
Created:February 20, 2009 Updated:February 25, 2009
Description: From the Mandriva advisory: Support was added for Intel 82567LM-3/82567LF-3/82567LM-4 network adapters, a bug in sunrpc causing oops when restarting nfsd was fixed, a work around for a bug in Walkman devices was added, the sound drivers got some fixes, and a few more things were fixed. Check the package changelog for details.
Alerts:
Mandriva MDVSA-2009:027 kernel 2009-02-20

Comments (none posted)

libpng: arbitrary code execution

Package(s):libpng CVE #(s):CVE-2009-0040
Created:February 23, 2009 Updated:July 13, 2009
Description:

From the SecurityFocus advisory:

The 'libpng' library is prone to multiple memory-corruption vulnerabilities because it fails to properly initialize data structures. Successful exploits may allow remote attackers to cause denial-of-service conditions or potentially execute arbitrary code on computers running the affected library. These issues affect versions prior to 'libpng' 1.0.43 and 1.2.35.

Alerts:
Gentoo 201412-08 insight, perl-tk, sourcenav, tk, partimage, bitdefender-console, mlmmj, acl, xinit, gzip, ncompress, liblzw, splashutils, m4, kdm, gtk+, kget, dvipng, beanstalkd, pmount, pam_krb5, gv, lftp, uzbl, slim, iputils, dvbstreamer 2014-12-11
openSUSE openSUSE-SU-2014:1100-1 Firefox 2014-09-09
Gentoo 201209-25 vmware-player 2012-09-29
Oracle ELSA-2012-0317 libpng 2012-02-21
Debian DSA-1830-1 icedove 2009-07-12
Fedora FEDORA-2009-6531 libpng 2009-06-18
Fedora FEDORA-2009-6603 libpng 2009-06-18
SuSE SUSE-SA:2009:023 MozillaFirefox 2009-04-20
Mandriva MDVSA-2009:083 mozilla-thunderbird 2009-04-01
Fedora FEDORA-2009-2882 thunderbird 2009-03-21
Fedora FEDORA-2009-2884 thunderbird 2009-03-21
Debian DSA-1750-1 libpng 2009-03-22
SuSE SUSE-SA:2009:012 MozillaFirefox 2009-03-16
Gentoo 200903-28 libpng 2009-03-15
rPath rPSA-2009-0046-1 libpng 2009-03-12
Mandriva MDVSA-2009:075 firefox 2008-03-13
Fedora FEDORA-2009-1976 libpng10 2009-02-24
Fedora FEDORA-2009-2045 libpng10 2009-02-24
CentOS CESA-2009:0315 firefox 2009-03-06
Ubuntu USN-730-1 libpng 2009-03-06
Ubuntu USN-728-1 firefox-3.0, xulrunner-1.9 2009-03-05
CentOS CESA-2009:0333 libpng 2009-03-05
CentOS CESA-2009:0340 libpng 2009-03-05
CentOS CESA-2009:0325 seamonkey 2009-03-05
Red Hat RHSA-2009:0340-01 libpng 2009-03-04
Red Hat RHSA-2009:0333-01 libpng 2009-03-04
Red Hat RHSA-2009:0325-01 seamonkey 2009-03-04
Red Hat RHSA-2009:0315-00 firefox 2009-03-04
SuSE SUSE-SR:2009:005 dhcp, ntp/xntp, squid, wireshark, libpng, pam_mount, enscript, eID-belgium, gstreamer-0_10-plugins-good 2009-03-02
Fedora FEDORA-2009-2131 mingw32-libpng 2009-02-26
Fedora FEDORA-2009-2112 libpng 2009-02-26
Fedora FEDORA-2009-2128 libpng 2009-02-26
Mandriva MDVSA-2009:051 libpng 2008-02-23
Slackware SSA:2009-051-01 libpng 2009-02-23

Comments (none posted)

perl-Crypt-OpenSSL-DSA: improper error check

Package(s):perl-Crypt-OpenSSL-DSA CVE #(s):CVE-2009-0129
Created:February 19, 2009 Updated:February 25, 2009
Description: The Perl Crypt-OpenSSL-DSA module misses an error. From the Fedora alert: The Crypto::OpenSSL::DSA module now croaks upon error rather than returning a -1 to ensure programmers are not caught by surprise which only checking for non-zero results.
Alerts:
Fedora FEDORA-2009-2090 perl-Crypt-OpenSSL-DSA 2009-02-25
Fedora FEDORA-2009-1914 perl-Crypt-OpenSSL-DSA 2009-02-19

Comments (none posted)

php: remote file inclusion vulerability

Package(s):php CVE #(s):CVE-2009-0577
Created:February 19, 2009 Updated:February 25, 2009
Description: php has a remote file inclusion vulerability. From the vulnerability database entry: PHP remote file inclusion vulnerability in function.inc.php in ACGVclick 0.2.0 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the path parameter.
Alerts:
CentOS CESA-2009:0308 cups 2009-02-19
Red Hat RHSA-2009:0308-01 cups 2009-02-19

Comments (none posted)

php: arbitrary file overwrite

Package(s):php CVE #(s):CVE-2008-5625
Created:February 23, 2009 Updated:February 23, 2010
Description:

From the CVE entry:

PHP 5 before 5.2.7 does not enforce the error_log safe_mode restrictions when safe_mode is enabled through a php_admin_flag setting in httpd.conf, which allows context-dependent attackers to write to arbitrary files by placing a "php_value error_log" entry in a .htaccess file.

Alerts:
SuSE SUSE-SR:2010:005 fetchmail, krb5, rubygem-actionpack-2_1, libexpat0, unbound, apache2-mod_php5/php5 2010-02-23
Gentoo 201001-03 php 2010-01-05
rPath rPSA-2009-0035-1 php 2009-03-02
Mandriva MDVSA-2009:045 php 2009-02-20

Comments (none posted)

pycrypto: arbitrary code execution

Package(s):pycrypto CVE #(s):CVE-2009-0544
Created:February 23, 2009 Updated:May 13, 2009
Description:

From the Mandriva advisory:

A vulnerability have been discovered and corrected in PyCrypto ARC2 module 2.0.1, which allows remote attackers to cause a denial of service and possibly execute arbitrary code via a large ARC2 key length.

Alerts:
SuSE SUSE-SR:2009:010 firefox apport evolution freetype2 java_1_4_2-ibm kdegraphics3 libopenssl libsoup xulrunner opensc python-crypto unbound xpdf 2009-05-12
Gentoo 200903-11 pycrypto 2009-03-09
Ubuntu USN-729-1 python-crypto 2009-03-05
Debian DSA-1726-1 python-crypto 2009-02-25
Mandriva MDVSA-2009:050-1 python-pycrypto 2009-02-23
Mandriva MDVSA-2009:049-1 pycrypto 2008-02-23
Mandriva MDVSA-2009:050 python-pycrypto 2009-02-20
Mandriva MDVSA-2009:049 pycrypto 2009-02-20

Comments (none posted)

trickle: local code execution

Package(s):trickle CVE #(s):CVE-2009-0415
Created:February 25, 2009 Updated:February 25, 2009
Description: The trickle bandwidth shaper can be fooled into loading arbitrary local code.
Alerts:
Fedora FEDORA-2009-1694 trickle 2009-02-13
Fedora FEDORA-2009-1675 trickle 2009-02-13

Comments (none posted)

vim: arbitrary code execution

Package(s):vim CVE #(s):CVE-2009-0316
Created:February 23, 2009 Updated:February 25, 2009
Description:

From the Mandriva advisory:

Python has a variable called sys.path that contains all paths where Python loads modules by using import scripting procedure. A wrong handling of that variable enables local attackers to execute arbitrary code via Python scripting in the current Vim working directory

Alerts:
Mandriva MDVSA-2009:047-1 vim 2008-02-24
Mandriva MDVSA-2009:047 vim 2009-02-20

Comments (none posted)

Page editor: Jake Edge
Next page: Kernel development>>


Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds