Slashdot Mirror


OpenSSH Package Trojaned

cperciva writes "The original story is here. And more details are available from the guy's weblog here." Here's a mirror of that email message. Another reader writes, "Not really a trojan because all it does is make a connection to 203.62.158.32:6667." Still another writes "The tarball of the portable OpenSSH on ftp.openbsd.org is trojaned. The backdoor is only used during build - generated binaries are fine." There isn't much authoritative information available, but this appears legitimate - please be careful if you're updating any of your machines with code from ftp.openbsd.org, and we'll update this story with more links as information is available. Update: 08/01 19:13 GMT by M : OpenSSH now has an advisory.

23 of 566 comments (clear)

  1. I'm suprised... by DJPenguin · · Score: 2, Insightful

    ...that this doesn't happen more often.

    People keep harping on about how open source software means that they can trust downloaded source code, but who actually reads through to source code for something before they actually compile?

    Usually it's just ./configure && make && make install.

    James

  2. How many people do check the MD5 checksum? by frleong · · Score: 3, Insightful
    Do you check the packages downloaded from sites that you usually do not have problems with? Like from redhat.com, debian.org and in this case openbsd.org?

    Also, how many people do read the makefiles before running them on your machine? And when installing binaries require root access?

    If this story is really true, how much safer is open-source programs, when compared with closed source programs? Notice that even with closed source programs, *some* people will eventually discover that they are trojan or not.

    --
    ¦ ©® ±
    1. Re:How many people do check the MD5 checksum? by maxwell+demon · · Score: 2, Insightful

      Well, the problem with the md5 checksum is that it only protects against download errors, not against replacement at the server (unless you have an independent source for that checksum): It's trivial to calculate the checksum for the changed package, and if you manage to replace the package file, you most probably manage to replace the file with the md5 key as well.

      The only way to really secure against such replacements is to use public-key cryptography to sign the package. Then no one can recreate the signature without having the private key.

      Maybe for installing, a safer way would be to give the user account temporarily access to the destination directories, then install as a user, and finally change owner permissions by hand. Of course this won't work if installation consists of more than just copying files to other directories, and this extra stuff needs root permissions. However, I guess that's rare.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:How many people do check the MD5 checksum? by Mr_Silver · · Score: 3, Insightful
      The guy caught it because of the installer automatically checking the MD5 checksum

      I'm a little confused. How can you trust a package to check it's own MD5 checksum? If I'd slipped a malicious program into another app, the next thing I would do is hack the checking code to falsly tell the user than the checksum is fine.

      --
      Avantslash - View Slashdot cleanly on your mobile phone.
  3. Re:203.62.158.32 by CrazyDuke · · Score: 3, Insightful

    Packet kiddies like to have their zombies join an irc channel so they can tell the bots to ddos by just typeing something like "!flood 127.0.0.1."

    I dunno if thats what this one does though.

    --
    Any sufficiently advanced influence is indistinguishable from control.
  4. Re:203.62.158.32 by jorleif · · Score: 2, Insightful

    Except if the port was closed recently when this whole thing came out?

  5. Re:Trojan by Anonymous Coward · · Score: 1, Insightful
    Tell me how this isn't a trojan again?

    It is a trojan, like the article title says. It's a completely independent program that a user is tricked into running on his own box that does something other than that user expects.

  6. Re:How to stop this happening again? by tburkhol · · Score: 2, Insightful
    Has anyone else thought about ways to solve this problem?

    Check MD5 sums

    make -n

    Unplug from the net and log all traffic while you compile, install and test. Check the log.

    Don't unpack a tarball within 48 hours of its creation...let someone else find the problems.

    Be one of the "many eyes" and actually learn some of the source code.

  7. Re:203.62.158.32 by JPriest · · Score: 2, Insightful

    What exactly are the odds of that?

    --
    Saying Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders.
  8. Re:hmmm.... by NumberSyx · · Score: 2, Insightful

    So tell me, are you 100% sure Word isn't Trojaned ? Seriously thousands of programers have worked on it over the years, how can we be sure a Trojan wasn't introduced. Microsofts policy is not to do complete rewrites of code, they always start with what they already have, try to fix bugs and add features. It is certainly within the realm of possibility that a Trojan has existed in Word for years undetected (it is not likely, but it is possible). Even if they did find it, they would certainly take it out in the next version or even in a service pack, but they probably wouldn't tell anyone and they would only admit to it if a third party exploited it and made it public.

    --

    "Our products just aren't engineered for security,"
    -Brian Valentine,VP in charge of MS Windows Development

  9. Why not hack the md5 checksums? by Anonymous Coward · · Score: 2, Insightful

    I download lots of tarballs from sites that provide a sum file as well. Presumably, you check the file to make sure it's checksum matches that in the sum file. If it does, you should be good to go.

    So, in this case, couldn't someone just as easily generate an md5 sum for the hacked file and put that in the sum file? I know on bsd you have ports which would prevent this, but what about Linux? Everything would seem kosher if the hax0r replaced the sum file...

    thx for responses.

  10. GnuPG a good idea by giminy · · Score: 2, Insightful

    Once again I call people's attention to GPG, which can be used to digitally sign source code. Then, if something is trojaned, you know who to blame for including the bum code.

    --
    The Right Reverend K. Reid Wightman,
  11. Not the fault of OpenBSD? by Anonymous Coward · · Score: 1, Insightful

    Are you saying it's not the fault of the OpenBSD OS or the OpenBSD team?

    If they are the ones managing the box, why aren't they securing it? If they aren't in a position to manage the box, why are they even using it?

    Also, nobody has done a report on how the trojan was uploaded, so we can't say for sure it was the fault of the OS. It could have been a sniffed password, or social engineering, or whatever.

    These guys do good work, but don't discredit the possibility that they make mistakes themselves once in awhile.

  12. Re:hmmm.... by Anonymous Coward · · Score: 1, Insightful
    Microsofts policy is not to do complete rewrites of code

    Microsoft does not have policy against code rewrites.

    I hate the evil bastards from Redmond more than anybody, but still, don't be absurd: all programmers would prefer not to reinvent the wheel.

  13. How to fix this from the site it's calling by bee · · Score: 3, Insightful

    Since the trojan dies if it sees an A first thing, obviously the guy running the box it's trying to contact should run something like this:

    yes "A" | nc -p 6667

    Then every daemon that connects gets an A right away, and thus dies. End of problem.

    --
    At least mafia-owned pizzarias make excellent pizza. Compare to Bill Gates.
  14. Re:Open Source PKI Needed? by fizbin · · Score: 3, Insightful

    Except that then you would be bitten by stuff like this that trojans the makefiles.

    As far as trojaning individual .deb packages, apt-get will indeed abort if the download md5sum doesn't match the md5 recorded in the Packages file. However, there is damn near nothing to verify that the Packages file is what it ought to be. (And since .debs and Package files are pulled from the same place...)

    Every time this comes up on debian-devel the end result is a classic example of "the best is the enemy of the good". The suggestions for minimal signing of anything (say, having the process that creates the Packages file sign it) are always rejected because they wouldn't address the whole problem. (What if master.debian.org were hacked?) Unfortunately, no one can ever come up with an acceptable consensus definition on what the whole problem actually is, so nothing ever comes close to being implemented.

  15. public key authentication by gimpboy · · Score: 2, Insightful

    another more likely possability would be that he was using passwordless authentication. so by rooting a box he has access to, the cracker could ssh to any other computer/user with his public key in the authorized_keys file. they could also scp the trojaned file in the same manner. this is not very unlikely.

    --
    -- john
  16. Trolling for karma, eh? by Inoshiro · · Score: 4, Insightful

    Alan Cox was calling Theo to task because he didn't like how Theo concealed the exact security problem until a workaround was given out. This is an attitude some developers have. It's not the best attitue from a customer/end-user standpoint, but some people who write code and give it for free use still don't understand it. Alanx Cox sounds like, despite him being a valuable asset to the community, he does not understand this.

    If he'd have said, "for all we know, OpenBSD could attract near-earth bodies" would you post this comment as "eerily prescient" on the recent asteroid stories? Sometimes things just aren't related. Despite what Mulder may think.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
  17. Where are the public keys? by Anonymous Coward · · Score: 2, Insightful

    The md5sums are not enough. Someone trustworthy[1] should
    sign the package and then make the public key available
    from various other trustworthy sources (three, at least).
    Red Hat does this *right*:

    http://www.redhat.com/solutions/security/news/pu bl ickey.html

    Both the openssh and openssl people have to make pages like
    the one above. If such pages do exists please pretty please
    post them here because I haven't seen them. Where are the
    "official" openssh and openssl public keys? They are not
    mentioned anywhere on either sites' pages!

    [1] The definition of "trustworthy" is not trivial. Personally,
    a public key found on both the Red Hat site *and* a
    box-wrapped CD qualifies. YMMV.

  18. Bad news and Good news by Sloppy · · Score: 2, Insightful
    OpenBSD's reputation has taking a bit of a beating lately, but a lot of it has been mostly superficial. The recently-found bugs in OpenSSL and OpenSSH don't really bother me a lot. Programming mistakes happen, and it looks like they're getting found. (Whether they're being found as part of the auditing process or because someone got bitten and was investigating why it happened, I don't know. I haven't looked into it.) And when they're getting found, fixes are being distributed lightning fast.

    I don't think these bugs are symptoms of a systemic problem.

    This trojan disturbs me a bit more than those bugs buried in thousands of lines of code. I guess I expect the OpenBSD guys to be good sysadmins, since, well, it just seems like something that should be their bag, baby. And maybe some will disagree with me, but I think that securely adminning a box is easier than writing secure code. (Maybe I'm just prejudiced because I'm a programmer. ;-)

    If a trojan got onto OpenBSD's own FTP server, it means that somebody fucked up. Maybe they're not keeping their box up-to-date with the latest fixes. (And it looks like they're not "eating their own dog food," and eating Sun dog food instead. That is ridiculous.) Or maybe, worst of all, some black hat knows about a hole that nobody else knows about. I don't know; I just know I really don't like this. I hope they get on the ball, regarding their unsecure server, muy pronto.

    There is a good side to all this, though. I actually give money to OpenBSD (not a lot, but it's something) because I want somebody out there doing OS and OS-related stuff, to be over-the-top paranoid, and I think OpenBSD is the right team (I guess they've got the best slogans). I selfishly want more secure tools to get into circulation, so that I can be among those who use them. And from that perspective, this incident is a fscking godsend, because I think it might result in people starting to adopt some better habits, which will also require some better tools and social networks:

    The solution to this trojan problem is not for people to start checking the MD5 sum on their tarballs. If you can't trust an FTP server to give you an unaltered file, then you can't trust a web server to give you a web page with an unaltered MD5 sum. Surely this is common sense?

    The real solution is digital signatures (i.e. an MD5 sum encrypted with a private key). And for that to really work, we're going to have to build up a web of trust, so that people will know whether or not they really have a publisher's public key, or an imposter's. Maybe this will get us a little closer to the day when I can encrypt every email I send, and have to decrypt ever email I receive, except for the spam which gets thrown away automatically since it's the only thing that isn't signed by someone accountable.

    It is hard to get people to use GPG. Real hard. Try convincing a friend (I mean a geeky friend; non-geeks are impossible) to use it, or try to organize a signing party sometime. I don't know why there's so much resistance and apathy, but it's there. We need all the help we can get, and today we got some.

    --
    As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
  19. Re:What else is modified? by SN74S181 · · Score: 2, Insightful

    You raise a point that for some reason everybody here is ignoring.

    I don't care how fancy the mechanism is to catch this kind of thing. All fine and well.

    How did the trojan get into the code in the first place? Are we to assume there's no oversight in code submissions for a package as critical as OpenSSH?

    In any commercial entity where a problem like this was uncovered, there would be a thorough audit of the submission path in process. Perhaps there is in this case as well. But why is nobody even discussing it??

  20. Re:Gentoo is Good to Go by glwtta · · Score: 3, Insightful
    Maybe now they will.

    why now? this whole episode seems to be a good example of the current system working well... tarball trojaned, ports system detects md5 mismatch, no compromise, no problem.

    --
    sic transit gloria mundi
  21. Re:Does this during the "make"? by 1729 · · Score: 2, Insightful
    In case you didn't already know this, you can easily check if there is: run netstat -a -n -p|less and check for any suspicious ports or processes. Better still, run pstree -p|less and check for any suspicious processes, whether they're connected to the network or not.

    Of course, this assumes that netstat and pstree haven't been replaced with compromised versions.