LWN: Comments on "Linux malware: an incident and some solutions" https://lwn.net/Articles/367874/ This is a special feed containing comments posted to the individual LWN article titled "Linux malware: an incident and some solutions". en-us Thu, 25 Sep 2025 16:30:36 +0000 Thu, 25 Sep 2025 16:30:36 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Linux malware: an incident and some solutions https://lwn.net/Articles/369055/ https://lwn.net/Articles/369055/ Felix_the_Mac <div class="FormattedComment"> <p> It should also be possible to say when installing a package: <br> <p> Allow NO network access<br> Allow only local subnet<br> Allow Internet access<br> <p> And the required level could be 'hinted' in the installer so that the user would be prompted <br> <p> "OpenOffice requests full network access? Is this OK? (Remember most programs do not need full network access)"<br> <p> <p> </div> Thu, 07 Jan 2010 17:22:27 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368655/ https://lwn.net/Articles/368655/ dlang <div class="FormattedComment"> but it is possible to install a script that when run by root after installation will modify /etc/profile.d<br> </div> Tue, 05 Jan 2010 05:47:54 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368646/ https://lwn.net/Articles/368646/ zooko <div class="FormattedComment"> That's the part that is (at least partially) solved by techniques like Nix. It is also partially solved by GNU stow. You can't give me a package which will sneakily install a script into my /etc/profile.d when I install your package using GNU stow.<br> <p> The basic idea is that you don't try to figure out what the code is going to do, you instead have a separate layer that has some (simple, easily verified) policy about the consequences of what the code does when you run it. In the case of GNU stow, that simple policy is that nothing gets written to outside of /usr/local . I don't understand Nix as well, but it seems like it enforces that nothing gets written outside of "/nix/store/22bharrqlcisnwa11a5qr0xazgvv64hk-firefox-3.5b4" where the big long random string is the secure hash of the actual contents of this particular version. (I'm copying this from <a href="http://lwn.net/Articles/337677/">http://lwn.net/Articles/337677/</a> .)<br> </div> Tue, 05 Jan 2010 00:10:21 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368639/ https://lwn.net/Articles/368639/ dlang <div class="FormattedComment"> the problem is in your first statement.<br> <p> Given an arbitrary script, it is not trivial to verify that it does or doesn't access files in any particular place. In any language it is fairly easy to obfuscate the actual path that's accessed by having that path be the result of some calculation<br> <p> I's not feasible to say "don't allow variables in a command" because for maintainability and readability there are a lot of very good reasons to do so.<br> </div> Mon, 04 Jan 2010 23:19:38 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368637/ https://lwn.net/Articles/368637/ zooko <div class="FormattedComment"> Suppose for example that <a href="http://gnome-look.org/">http://gnome-look.org/</a> offered packages in some format where it was trivial to verify that installing the package wouldn't write any files into system script directories such as /etc/profile.d . (It is not easy -- perhaps not even possible -- to verify such things about .deb packages. Perhaps if they were Nix packages <a href="http://nixos.org/nix/">http://nixos.org/nix/</a> instead then it would be easy.)<br> <p> Suppose then that the administrators of <a href="http://gnome-look.org/">http://gnome-look.org/</a> ran a script which confirmed that the eye-candy packages didn't install anything other than the appropriate eye-candy plugin code. (Note that they don't need to inspect any source code themselves -- they just have a script which inspects each new package when it is uploaded to confirm that nothing gets written outside of the appropriate location for eye-candy plugins.)<br> <p> Now here is my point: nobody needs to make judgments about the moral character of the authors of the plugins! This hypothetical Principle-Of-Least-Authority package management system (of which Nix may be an example or at least an ancestor), plus this hypothetical script that the owners of <a href="http://gnome-look.org/">http://gnome-look.org/</a> execute automatically on all new uploads, plus this hypothetical Principle-of-Least-Authority eye-candy plugin mechanism (of which Google Native Client is an example), combine so that you can happily invite the author of this malware to go ahead and submit a whole bunch more eye-candy plugins to <a href="http://gnome-look.org/">http://gnome-look.org/</a> , and millions of users can safely download his latest creations and stare at the pretty pictures.<br> <p> So the point that I'm trying to emphasize here is that discerning between good guys and bad guys among the authors of the software that you rely on is *not* the only way to defend against malware.<br> <p> And a good thing too, because that strategy is utterly hopeless for a large-scale software ecosystem. It is an appropriate strategy for Dunbar's-number-scaled ecosystems in which you basically know everyone involved personally and can form coherent opinions about each person's character. In other words, it was probably a great strategy for our ancestors ten thousand years ago, and that's probably why we continue to think of it as the right and natural thing to do today, even though it is utterly useless for today's situation.<br> </div> Mon, 04 Jan 2010 23:13:59 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368620/ https://lwn.net/Articles/368620/ hppnq The kind of attack you need to worry about is the one that is able to fool you, not so much the system. In the case of a screensaver that asks permission to run a script, some users may be able to answer correctly: no, of course not. But for a Firefox extension that rewrites a trusted link in a trusted webpage to a malicious one or opens a connection to a remote server? <em>You</em> are the weak link. <p> I think no amount of capability control will help decide, with acceptable confidence, what is trusted and what not -- not even if this would involve detection of normal usage and trust patterns -- <em>unless</em> the software was downloaded from a trusted site to begin with. <p> (I guess the problem of properly configuring a system that is exposed to uncontrolled outside input to perform a specific task is exactly as difficult as configuring it to prevent it. ;-) Mon, 04 Jan 2010 21:31:22 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368586/ https://lwn.net/Articles/368586/ giraffedata <Blockquote> I'm not sure, offhand, how capability controls on package installers would prevent granting of powers to undesired scripts within some packages while permitting them to others. </blockquote> <p> I can see it. It's a higher level of capability control than you're thinking of. Maybe implemented in dpkg itself. You request to install a package, but say, "This installation has no business setting up something that runs every time anyone logs in." In the case at hand, I believe if dpkg failed with a message saying, "you need to give me permission to install a login script," the user wouldn't have proceeded. <p> Indeed, that kind of constrainability of installs would help with <em>inadvertent</em> over-installation as well. Many times, I've had an installer helpfully configure something on my system for me -- something outside the scope of what I thought I was modifying by installing -- and later I had a devil of a time figuring out who changed it and how to change it back. Mon, 04 Jan 2010 19:08:28 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368332/ https://lwn.net/Articles/368332/ ccurtis <div class="FormattedComment"> I wonder if package installation tools could help here. Dropping to the commandline is always an 'advanced' option, but for the unwashed masses: what if 'dpkg-gui' shipped with a set of heuristics that classified packages based on their contents and displayed this to the user at install.<br> <p> In the gnome-look example, this 'dpkg-gui' could scan the file listing and display a dialog saying that (based on the various rules) the 'Waterfall' package contains:<br> <p> * GTK Themes<br> * Desktop wallpapers<br> * Icons<br> ! System configuration files<br> ! Maintainer scripts<br> <p> ... with appropriate warnings about the items marked with a '!'.<br> <p> The 'Maintainer scripts' type is (and always has been) a huge hole-in-the-waiting. You could scan each script looking for patterns ('/etc/', '/../') but the number of false positives (reading files versus writing) would be large - not to mention that any language could be used and the paths could be obfuscated easily.<br> <p> One could argue that a user should know that a theme doesn't require these scripts, but that's really asking too much. People coming from Windows, rightly or wrongly, place some trust the installer because they can always "back out". This is not a completely unreasonable position. Given the innate "root-ness" of system packages, Linux may even be an even more vulnerable target.<br> <p> Perhaps the 'Maintainer scripts' has a "Check..." option that creates a VM or a secure chroot/jail on top of a filesystem snapshot or overlay from which it can perform a delta analysis. It can then use this delta to amend the list of categories the package belongs to - perhaps highlighting new decisions in red, or disallowing them altogether.<br> <p> This is an issue that will need to be addressed, and user education is not the answer. Like debugging clever code, this arms race has to be fought between the programmers themselves - not between the attackers and the "OMG Ponies" folks.<br> <p> <p> </div> Thu, 31 Dec 2009 17:34:31 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368262/ https://lwn.net/Articles/368262/ paulj <div class="FormattedComment"> The screensaver framework can handle keyboard input and locking. The only thing the <br> untrusted part needs access to is a drawing API to the window on which the screensaver <br> should appear.<br> </div> Wed, 30 Dec 2009 14:02:31 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368254/ https://lwn.net/Articles/368254/ rickmoen <div class="FormattedComment"> I'm not sure, offhand, how capability controls on package installers would prevent granting of powers to undesired scripts within some packages while permitting them to others. E.g. it might even be the case that screensaver modules can legitimately be expected to be delivered within .deb archives sometimes, and legitimately include scripts.<br> <p> Rick Moen<br> rick@linuxmafia.com<br> </div> Wed, 30 Dec 2009 06:38:44 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368249/ https://lwn.net/Articles/368249/ zooko <div class="FormattedComment"> Dear Rick Moen: that's a good point, but capability access control could appropriately constrain the installation of packages just as it could constrain the display of eye-candy. In fact, we Linux-users are actually probably much closer to Principle-Of-Least-Authority package management than to Principle-Of-Least-Authority screen savers because of the NixOS project! <a href="http://nixos.org/nixos/">http://nixos.org/nixos/</a><br> </div> Wed, 30 Dec 2009 04:45:32 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368248/ https://lwn.net/Articles/368248/ rickmoen <p>Zooko, consider the mechanics of what happened at gnome-look.org: A nameless author contributed an alleged screensaver-module file in (at least) .deb format, and the site's automated scripts accepted and listed it. His/her listing either stated or implied that the user should download and "dpkg -i" it. <p>Putting user-system-level ACLs on what an eye-candy display for xlock is allowed to do doesn't address that particular threat model, because the attack was a social-engineering one against the user, to get him/her to install a distro package with root authority when no such access should be rationally needed just to install a screensaver. (An ACL approach such as you might discuss could help with actual screensaver files.) <p>The author's sentence "An incident like the WaterFall malware can only be avoided when users are trained not to trust third-party software blindly" strikes me as directed towards pondering how to make social-engineering threats less likely to succeed, and I agree with the author that those are a much larger threat than lack of a capabilities-enforcement mechanism for screensavers, wallpaper, themes, etc. <p>Rick Moen<br> rick@linuxmafia.com Wed, 30 Dec 2009 04:25:11 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368245/ https://lwn.net/Articles/368245/ dlang <div class="FormattedComment"> does a screensaver need to be able to accept (or detect) input from the keyboard and/or mouse?<br> <p> if so, then it is no longer good enough to lock things down as you describe, because the screensaver could pop up a image that looks like your desktop. with no other access it becomes a simple DOS (as opposed to a full trojan) but it would still be a nasty issue to troubleshoot.<br> <p> and if it isn't allowed to accept input, how can you have a locking screensaver?<br> <p> back in the c64 days I would do something similar. I could walk up to a machine on display in the store and a minute or so later walk away with the display looking the same (complete with the cursor moving), but anything you typed just responded with 'OK'<br> <p> on a display machine that just needed a (fast) power cycle to get back to normal, this was a prank. as a 1% of the time I cause you to loose all open files because the the screensaver takes over and makes it look like your box is dead it becomes more significant.<br> </div> Wed, 30 Dec 2009 01:56:19 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368244/ https://lwn.net/Articles/368244/ zooko <div class="FormattedComment"> "An incident like the WaterFall malware can only be avoided when users are trained not to trust <br> third-party software blindly."<br> <p> Argh. This is not the only possible solution! It makes me sad that the linux community assumes <br> that discriminating among sources of software is the only solution. That solution doesn't scale, <br> nor does it work even at the scale of software production and software use that we already have.<br> <p> The "other solution" -- the one that most people seem to find inconceivable -- is *don't give it <br> permission to do things that it doesn't need to do*. An eye-candy display for xlock doesn't need <br> to do anything other than generate pretty patterns on the screen. If that is all that it is able to <br> do, then it doesn't matter if you download your eye-candy from <a href="http://eyecandy.suspicious.ru">http://eyecandy.suspicious.ru</a> or <br> if you receive it in email from linus@kernel.org.<br> <p> Now implementing an access control mechanism that could enforce this while being usable is a <br> hard job (it would require capability access control instead of the access control lists that we <br> have now). But at least it is possible to solve the problem that way, unlike the "discriminate <br> among sources of software" way, which will never work unless we cut down the number of <br> contributors of open source software to a couple of hundred total programmers world-wide.<br> </div> Wed, 30 Dec 2009 01:43:42 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368086/ https://lwn.net/Articles/368086/ tzafrir <div class="FormattedComment"> That's because you consider them as packagers.<br> </div> Sat, 26 Dec 2009 14:21:52 +0000 NoScript and Adblock https://lwn.net/Articles/368079/ https://lwn.net/Articles/368079/ rickmoen Pete wrote: <p><em>http://lwn.net/Articles/332093/</em> <p>{shrug} The best solution to upstream antics is the one Jake Edge mentions, distro packages, which I always strongly, strongly encourage Linux newcomers to favour over going to upstream (absent rare reasons to the contrary). But NoScript / Adblock even with upstream antics are better than lacking them. Fortunately, both extensions are open source -- as many extensions advertised on https://addons.mozilla.org/ are not. <p>(My view, yours for a small royalty fee and waiver of reverse-engineering rights). <p>Rick Moen<br> rick@linuxmafia.com Sat, 26 Dec 2009 07:48:42 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368067/ https://lwn.net/Articles/368067/ smurf <div class="FormattedComment"> <font class="QuotedText">&gt;&gt; It's easy for anyone with shell access to the svn server</font><br> <font class="QuotedText">&gt;&gt; to go back and change someone else's past commit</font><br> <p> That's a SVN problem. With git, such a change would have to be propagated through the whole subsequent commit history. This would be immediately visible to anybody who re-syncs their git archive and then looks at the resulting merge tree. Not a perfect solution, but good enough; anyway, git also supports gpg-signed tags, which _are_ as perfect as one can get.<br> <p> The other distributed VCSes offer similar integrity features. But then, SVN is no _distributed_ VCS.<br> </div> Fri, 25 Dec 2009 18:15:43 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368048/ https://lwn.net/Articles/368048/ elanthis <div class="FormattedComment"> An even better question is why screensavers are submitted as dpkgs at all. Of hmome-look <br> wants to use native packages for this, require them to be submitted as simplifed source balls <br> and build the binaries and packages themselves, using a properly jailed build environment <br> (or even a vm instance).<br> </div> Fri, 25 Dec 2009 06:51:13 +0000 NoScript and Adblock https://lwn.net/Articles/368044/ https://lwn.net/Articles/368044/ pflugstad <div class="FormattedComment"> I completely agree with you. But then you went and mentioned NoScript and AdBlock:<br> <p> <a href="http://lwn.net/Articles/332093/">http://lwn.net/Articles/332093/</a><br> <p> Intentional?<br> <p> Pete<br> </div> Fri, 25 Dec 2009 03:10:59 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/368020/ https://lwn.net/Articles/368020/ rickmoen <p>And, I forgot to mention: Firefox extensions. I note that the Mozilla Organization's https://addons.mozilla.org/ "portal" site contributes substantially to the problem of dangerous user attitudes, by having no entry about source code or licensing on any of the extension entries, but a large, prominent button marked "Download Now" on each. I've encountered Linux users who've been completely unaware that what they fetched via that site was proprietary software from nobody in particular, that they would not have trusted with their user-level security access if they'd been thinking more clearly. <p>I suggest we of the Linux community work harder to get out the message that, e.g., just because we recommend Adblock and NoScript, that doesn't mean we recommend downloading arbitrary extensions from any-old-where, and that, when we provide URLs to Adblock and NoScript's upstream Web sites, we don't mean you should get it from there: You should get maintained, audited packages from your distro maintainers, where available -- and assume code is dangerous unless you have reason to think it isn't. <p>Rick Moen<br> rick@linuxmafia.com Thu, 24 Dec 2009 19:11:15 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/367994/ https://lwn.net/Articles/367994/ cortana <div class="FormattedComment"> dpkg --info blah.deb will display which of the preinst, postinst, prerm, postrm scripts the .deb has, <br> and whether they are shell scripts, perl scripts, etc.<br> <p> The question I want to ask is: why on earth did gnome-look not strip out all the scripts that <br> submitted debs contained? There is no need for a package containing a screen saver to contain <br> such as script; all you have to do is drop an executable somewhere, and a .desktop file in <br> /usr/share/applications/screensavers!<br> </div> Thu, 24 Dec 2009 16:34:33 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/367983/ https://lwn.net/Articles/367983/ rickmoen <p>It's unfortunate that nearly all articles about Unix malware start by thrashing the same stupid straw man about "Linux users like to think that they are not vulnerable". Any operating system that permits the user to destroy his/her own system's security is "vulnerable" in that trivial and rather meaningless sense of the word, and Unix furnishes the rope to hang yourself, spare blocks and tackles, and a few rope factories and foundries in case you want to make more. <p>So, when has it ever not been the case that "they too should be careful"? <p>The .deb was "on gnome-look.org" in the technical sense that it was made available by its third-party author at some URL of the form http://gnome-look.org/CONTENT/content- files/[something].deb, but even a cursory look at the site should have revealed to any member of the public that the site maintainers do effectively zero quality control, that it's an automated "portal" where "Everyone can upload and download artwork, applications, documents and other files." <p>So, it should have been obvious that the downloaded file was from nobody in particular, for starters -- but then there's the fact that it's a .deb, which requires root/sudo to install, and inherently supports preinst/postinst scripts, run as root. <p>None of which in the least differs from Koen Vervloesem's point that "An incident like the WaterFall malware can only be avoided when users are trained not to trust third-party software blindly", which is well taken, but there's only so much that can be done to dissuade novice sysadmins from destroying their systems. If they're willing to install as the root user software from unknown parties on the Internet just so they can have "the newest screen savers, themes, and other software to spice up their desktop", the best you can do is gently point them to the CERT document on recovery from root compromise and say "Gosh, it hurts when you shoot at your own foot, doesn't it?" <p>Even with "more software than the official repositories have", if it's not alleged screensavers, it'll be alleged Internet poker games, alleged video codecs for porn, alleged "birthday cards", etc. -- or various and sundry add-on Web apps. <p>The only way out is to keep reminding users they're responsible for whom they trust and what processes they run, teach them not to aim that gun at their feet, and teach them how to recognise that type of foot wound and how it got there. <p>Rick Moen<br> rick@linuxmafia.com Thu, 24 Dec 2009 12:49:23 +0000 Linux malware: an incident and some solutions https://lwn.net/Articles/367982/ https://lwn.net/Articles/367982/ tzafrir <div class="FormattedComment"> Just one comment regarding the dpkg command in the article: it lists the contents of a package. That, however, omits one very obvious place to hide malicious (or, well, buggy) code: the maintainer scripts.<br> <p> I'm not aware of a simple dpkg equivalent of the command 'rpm -q --scripts foo.rpm', but it should be along the lines of:<br> <p> dpkg --info foo.deb config preinst postinst prerm postrm <br> <p> </div> Thu, 24 Dec 2009 12:25:27 +0000