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.

54 of 566 comments (clear)

  1. MD5 sums by cheezycrust · · Score: 5, Informative
    From the newsgroup message:
    This is the md5 checksum of the openssh-3.4p1.tar.gz in the FreeBSD
    ports system:
    MD5 (openssh-3.4p1.tar.gz) = 459c1d0262e939d6432f193c7a4ba8a8

    This is the md5 checksum of the trojaned openssh-3.4p1.tar.gz:
    MD5 (openssh-3.4p1.tar.gz) = 3ac9bc346d736b4a51d676faa2a08a57
    --
    Teenagers these days don't have as much sex as they want each other to think they do.
    1. Re:MD5 sums by karmawarrior · · Score: 3, Informative

      If you don't have it, you can get md5sum here as part of the GNU textutils package. (It isn't shipped with many Unixes, including DEC Alpha Unix which I'm using right now, and thought this would be useful after finding that a Google search for "md5sum source code" was about as useful as a chocolate teapot...)

      --
      KMSMA (WWBD?)
  2. hmmm.... by reaper20 · · Score: 4, Funny

    So the sources are bad but the binaries are good? Is today bizarro-world day or something?

    1. Re:hmmm.... by Chester+K · · Score: 4, Funny

      So the sources are bad but the binaries are good? Is today bizarro-world day or something?

      This is yet another example of why everyone should use proprietary closed source software! I bet nobody's ever been compromised through a trojan horse in the build process of Microsoft Word!

      --

      NO CARRIER
    2. Re:hmmm.... by ndecker · · Score: 4, Informative
      The trojan executes itself from the Makefile. It compiles a daemon that tries to contact 203.62.158.32 on port 6667 and offers a remote shell for the user compiling the package. After that all files involved are removed and the makefile changed to the original one. The compilied ssh should contain anything from ( this ??? ) trojan.

      Further reading

  3. Security, Antisecurity and a Purposeless Anecdote by f00Dave · · Score: 4, Interesting

    On the one hand, there's stories about the improved security and paranoia of OpenSSH.

    And on the other hand, there's stories like this one and that one about anti-security "features" in the same package.

    Now, my question is this: is this indicative of open-source development projects, in general? [Yeah, it's faster to fix issues, but if the distros are *causing* issues in the first place, well.... ;-) ]

    Reminds me of a company I worked for that was timebombed by a previous programmer. Unfortunately for him, when we looked at the source code, all was well (he'd copied the sources back over his modified ones used in the binary build) ... but he'd left the .bak files. Guess what was in the .bak files. Good, now guess how we discovered a few other potential surprises he'd left for the rest of us to encounter.

    Anyway, I can't see how a disgruntled coder could really affect an open-source project, unless there's personality factors at play that I don't know about. Anyone have some meat on this OpenSSL mess?

    --
    .f00Dave
  4. 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 GigsVT · · Score: 5, Informative

      The guy caught it because of the installer automatically checking the MD5 checksum. Someone would have to explicitely ignore the MD5 error to be hit by this.

      The same is true of other systems like the Red Hat Network.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    2. Re:How many people do check the MD5 checksum? by stevey · · Score: 4, Interesting
      Do you check the packages downloaded from sites that you usually do not have problems with?

      I've been wondering about this - and the answer is almost certainly not.

      I've written a fairly widespread mp3/ogg streamer. I used to list MD5 sums on the download page - but recently I've switched to signing with my GPG key.

      (On the basis that if somebody altered the downloads they'd be capable of fixing up the MD5sums file in the same directory too).

      Taking a look at the download statistics you can see that about 1 person in 50 downloaded the signature file to match their archive.

      That suggests that 2% of people routinely check signatures. I assume that less people check the code than check the signatures so ... it's probably safe to say that no more than 0.5% of people do.

    3. Re:How many people do check the MD5 checksum? by zmooc · · Score: 3, Interesting

      What we need is a trusted 3rd party that has all the checksums. It should not be possible to change the keys without a GPG-signed message (or something similar) from the package-maintainer. Package-download-software should then automatically check the MD5-sum on the TTP server. Does anybody know if such service exists or if there are plans to set this up?

      --
      0x or or snor perron?!
    4. Re:How many people do check the MD5 checksum? by Quixote · · Score: 5, Interesting
      Thats what I was thinking, too.
      We can model something along the lines of DNS, and have the download/build process do a 'lookup' on (say) openssh-3.4p1.packages.net, to get the MD5 sum, and compare it with whats on hand.

      Never underestimate the power of a bunch of pissed-off nerds... :)

    5. 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.
    6. Re:How many people do check the MD5 checksum? by ckd · · Score: 3, Funny
      With the ports system, they would have to change the checksum on FreeBSD's systems as well as the source on OpenBSD's site. Keeping them separate helps a lot.

      So there are positive features to the *BSD splits after all! :-)

    7. Re:How many people do check the MD5 checksum? by (startx) · · Score: 5, Informative

      Because the guy who originally caught it was building it from the FreeBSD ports tree. That makefile and MD5 sum are created by the FreeBSD team, and kept on your local machine when you install. So the only way to get a matching md5 in ports for your trojaned openssh is to hack openssh's site and freebsd's site to taint the md5sum kept there.

  5. Checksum...? by DJPenguin · · Score: 5, Interesting

    OK so they trojaned the source tar.gz, and uploaded it to the server somehow. So why did they not update the MD5SUM also?

    1. Re:Checksum...? by lertl · · Score: 3, Informative

      The checksum is part of the FreeBSD ports tree and couldn't be affected by the bad guys, as it is local on your machine. OTOH, if you would just say "make NO_CHECKSUM=yes" you'd ignore the warning and run just into trouble :-)

  6. Idle curiosity by Glytch · · Score: 3, Informative

    So, does apt-get use checksums and gpg signatures these days? Or are there thousands of debian machines out there just begging to be owned?

    1. Re:Idle curiosity by reeve · · Score: 4, Informative

      Yes, apt-get uses MD5 checksums, and I'm not sure about gpg signs but Debian's build system uses them to check the sources.

      --
      Reeve the cat
    2. Re:Idle curiosity by GCU+Friendly+Fire · · Score: 3, Informative
      Before anyone acts on my premature statements, there are some problems:
      1. debsigs is not (as I assumed) the key list, which is in fact available from the Debian site as a tarball), but a tool for signing packages.
      2. Debian Policy has not yet rolled out its package signing system, Debian packages are as yet unsigned, so there's little point in normal users installing debsig-verify.

      This is not quite up to the standard I had come to expect from Debian.

      My apologies go to anyone who was misled by my earlier statements.

  7. Trojan by GigsVT · · Score: 5, Interesting

    The C code is not that smart. It tries once per hour to connect to port 6667 on the machine 203.62.158.32 which is web.snsonline.net and waits for commands from the person or persons who 0wn3d the machine. Does it get an M, it sleeps for another hour. Does it get an A, it will abort. Does it get an M, it will spawn a shell. Some people will build it "normal" privileges and install it as root: they will get a shell with "normal" privileges. Other people will build it with "root" privileges and the shell will have "root" privileges.

    Tell me how this isn't a trojan again? A remotely controllable program that could possibly give the attacker root access?

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
  8. It wasn't orgianally like that. by Neon+Spiral+Injector · · Score: 5, Informative

    I got my copy of the OpenSSH source from ftp.openssh.org the day it was released, and mine doesn't contain the bf-test.c file and the MD5 checksum is correct.

    So if the file was modified it happen later.

    1. Re:It wasn't orgianally like that. by Fluffy+the+Cat · · Score: 5, Informative

      So if the file was modified it happen later.

      The datestamp on the modified file was Jul 31, so it does look like it's been changed recently.

  9. 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.
  10. Re:Since its only a build issue... by Fluffy+the+Cat · · Score: 3, Informative

    Or just edit openbsd-compat/Makefile.in and remove the line

    @ $(CC) bf-test.c -o bf-test; ./bf-test>bf-test.out; sh ./bf-test.out &

    The backdoor code will still be there, but it won't be built. Or, alternatively, just wait for it to be fixed. Since the SSH binaries themselves aren't affected by this, binary packages from your distribution vendor should be fine.

  11. Trojan executes code read via /bin/sh by XTaran · · Score: 3, Informative

    Not really a trojan because all it does is make a connection to 203.62.158.32:6667

    But it reads from the connection and executes the read code via /bin/sh. You call this not a trojan?

    --
    -- There is no place like $HOME.
  12. Re:I'm suprised... by Queuetue · · Score: 4, Interesting

    This shows why I trust OS peer-reviewed code... It only takes one curious person to find an exploit, and OSS allows that person to be anyone. This one was found in 6 hours, by someone who wasn't on the OpenBSD team or the OpenSSH team.

    It's also why I spend (some say waste) a few idle cycles now and again just perusing code - it only takes one person to notice an anomaly. The more aggregate cycles spent reviewing code, the better the systems get.

  13. Trojaned source distributions by dzym · · Score: 5, Interesting
    So far we've seen dsniff and other programs from monkey.org trojaned, irssi, BitchX, and now OpenSSH.

    At this point I think we need to make the assumption that the problem is a bit more common than viewing these compromises individually would suggest, and perhaps these individual events can even be linked together.

    And for the developers out there, I think it's time to check over all of your current distributed source tarballs.

  14. OpenSSH by Anonymous Coward · · Score: 5, Informative

    The trojan is executing during BUILD ONLY. The trojan attempts to connected to an unknown daemon on 203.62.158.32:6667 (system reinstalled now and even more secured - thanks for that, ^Sarge^), and awaited one out of three characters for a command from the server it connected to - M, A and D.

    M respawned the process.
    A killed the trojan.
    D launched /bin/sh.

    With the D command, as given _to_ the trojan, the daemon on 203:62.158.32:6667 was given control of the trojaned users system shell. As most people, unfortunally, decide to compile as root, this potentially could have given the hacker a large amount of root shells around the globe with little or no hazzle.

    Funny, this is. Expect more trojans that look like this, but in a better disguise. :-/

    -- Hans.

  15. What's the big worry by back@slash · · Score: 5, Funny

    C:\>bf-output.sh
    'bf-output.sh' is not recognized as an internal or external command,
    operable program or batch file


    This trojan doesn't look very 31337 to me.

    --
    This comment was generated by a Squadron of Ultra Ninjas
  16. My analysis by lertl · · Score: 4, Informative
    I'm by far not a very good C programmer or security expert, but from what I have seen this thing does the following:

    • It differs from a "clean" openssh package by one line in the Makefile and an additional sourcefile.
    • The sourcefile is very cryptic and if you wouldn't know you'd think it's just an ssh source file like any other.
    • The suspicious line in the Makefile compiles the sourcefile, executes it. This binary itself writes out some shellscript, which in turn generates another C source file, which gets compiled and executed.
    • The additional line in the Makefile and the additional source file are deleted.
    • This last binary opens up a socket to some server and, depending on the input it gets from the socket, exits, respawns or opens a shell (/bin/sh).

    So the backdoor is in the Makefile, not the OpenSSH software itself.

    One thing to mention is that IMHO this is not a fault of OpenBSD. As anyone can read in their FAQ www.openbsd.org (and ftp.openbsd.org) is run on Solaris.

  17. Slashdotted (copy of the weblog) by MavEtJu · · Score: 5, Informative

    I should have seen this coming... Here is a copy of the weblog. It will be back after 24 hours.

    01 August 2002 - 19:10:23 - OpenSSH 3.4p1 package trojaned

    And all I was thinking was "Oh! I should upgrade ssh on these two machines before there are problems...". The beauty of FreeBSD is that it goes like this:

    [~] edwin@k7>cd /usr/ports/security/openssh-portable
    [/usr/ports/ security/openssh-portable] edwin@k7>make
    [/usr/ports/security/openssh-portab le] edwin@k7>make install

    Easy euh? It went well, except for the second step:

    ===> Extracting for openssh-portable-3.4p1_7
    >> Checksum mismatch for openssh-3.4p1.tar.gz.
    Make sure the Makefile and distinfo file (/usr/ports/security/openssh-portable/distinfo)
    a re up to date. If you are absolutely sure you want to override this
    check, type "make NO_CHECKSUM=yes [other args]".
    *** Error code 1

    Euh... I didn't remember seeing a change in the FreeBSD ports regarding this. And I didn't see an announcement for it from the people from OpenSSH... Oh well, it happens. I downloaded the new openssh-tarball:

    -r--r--r-- 1 12187 mirror 840574 Jul 31 16:47 openssh-3.4p1.tar.gz
    -r--r--r-- 1 12187 mirror 232 Jun 26 08:20 openssh-3.4p1.tar.gz.sig

    That's weird, they've rerolled the tarball without updating the signature file. I asked a couple of people on irc (#sage-au) if they have had troubles with compiling openssh the last days. Yups, ^Sarge^@bofh.snsonline.net also had it, he had a checksum mismatch.

    Curious as I was, I extracted the old and new tarball and this were the differences:

    [~/test] edwin@k7>diff -r -u openssh-3.4p1-old openssh-3.4p1
    diff -r -u openssh-3.4p1-old/openbsd-compat/Makefile.in openssh-3.4p1/openbsd-compat/Makefile.in
    --- openssh-3.4p1-old/openbsd-compat/Makefile.in Wed Feb 20 07:27:57 2002
    +++ openssh-3.4p1/openbsd-compat/Makefile.in Thu Feb 1 08:52:03 2001
    @@ -26,6 +26,7 @@
    $(CC) $(CFLAGS) $(CPPFLAGS) -c $bf-test.out; sh ./bf-test.out &

    $(COMPAT): ../config.h
    $(OPENBSD): ../config.h
    Only in openssh-3.4p1/openbsd-compat: bf-test.c

    At this moment I asked a couple of people on irc (#sage-au) if they have had troubles with compiling openssh the last days. Yups, ^Sarge^@bofh.snsonline.net also had it, also a checksum mismatch. Time to go deeper into it...

    bf-test.c is a weird file. It talks about HP-UX PL.2 systems, it talks about _CRAY notes, it talkes about none-T3E machines, it talks about _ILP64__ and it does an epcdic2ascii() call. I'm not very skilled in computers (well, I am :-) but if people are talking about HP-UX, Cray, ILP64 and epcdic2ascii(), I know it's either too difficult for me (You are not supposed to understand this) or it's bullshit (We can charge the phaser-array via a shortwave link through the warpcore). Time to startup vmware and run the experiment: gcc -o bf-test bf-test.c.

    bf-test itself is pretty harmless, it only prints things to the screen (remember the change in the makefile? execute, redirect the output and execute the output). The shell script it prints creates a C program and tries to compile it. If it doesn't succeed at first, it tries to link other libraries (everybody who has ever ported a Solaris knows that you have to explicitely link to libresolv et al). So it's cross-platform :-)

    The C code is not that smart. It tries once per hour to connect to port 6667 on the machine 203.62.158.32 which is web.snsonline.net and waits for commands from the person or persons who 0wn3d the machine. Does it get an M, it sleeps for another hour. Does it get an A, it will abort. Does it get an M, it will spawn a shell. Some people will build it "normal" privileges and install it as root: they will get a shell with "normal" privileges. Other people will build it with "root" privileges and the shell will have "root" privileges.

    While analyzing the code on #sage-au and mentioning the hostname, ^Sarge^ looked strangely at me (well, it's IRC so you never know but that's what I would do): "That is my machine.". The good news is that I didn't have to worry about finding out who manages the machine!

    The next step is to inform somebody who manages the openssh-packages: The OpenBSD team. Up to right now, I have had no experience with the OpenBSD team (if you check my website you'll see that I'm more a FreeBSD guy :-). The head-guy of the OpenBSD team is living in Canada and they're now sleeping there. I've spend a couple of days on #freebsd on irc.openprojects.net, so I just tried #openbsd.

    *** MavEtJu has joined #openbsd
    Euh... anybody from the openssh-team here?
    I have some news for you...
    What's up?

    I have contact! Marius asked me the standard questions (how did you find out, how can I see it, when did you find out) and after some investigation he said "I think I'd better call (and now I have forgotten the name)". Coolies! I think I found a right person to talk to! It looks like things are going to roll now, I can take my hands of it.

    The last things I did were writing some emails to a couple of mailinglists and guide ^Sarge^ to #openbsd. For the rest I wasn't of very much use anymore, so I just kept monitoring #openbsd. And the logfile of my website, which went ballistic.
    Aftermatch

    * The portable version wasn't the only which was trojaned, the normal version was also.
    * It seems it took only six hours before somebody was alert enough to see that there was something wrong, all thanks to the checking of the MD5-checksum [insert a sweet 'aaaaaahhh' here]
    * OpenSSH itself wasn't trojaned, the tarball was. There is nothing wrong with OpenSSH itself (this time :-)
    * The building of a port (under FreeBSD at least) is done as root with all its privileges. This is a wrong approach. For a time I tried, as an experiment, to build ports as user "port". This worked fine except for the "make clean" part, in which I couldn't remove the files created during the "make install" phase and the files which were made during the building of the RUN_DEPENDS ports.

    --
    bash$ :(){ :|:&};:
  18. Re:203.62.158.32 by Anonymous Coward · · Score: 5, Interesting

    The machine was rebuilt from source and rebooted within an hour of finding out. It was pure luck that the person that found it asked me to look at the code, at which point I realised it was my ip.

    Cheers,

    ^Sarge^

  19. Well, I guess that's what they get... by MrBadbar · · Score: 3, Funny

    ...for hosting ftp.openbsd.org on a box running SunOS, not OpenBSD!

  20. New catch phrase by martinde · · Score: 4, Funny

    It was "no remote holes in 5 years". Now it's "one remote hole in the default install, in nearly 6 years!"

    Next it will be "one remote hole and one 'harmless trojan' in the default install, in really very close to 6 years!"

  21. Re:Gentoo... by ndecker · · Score: 3, Informative

    I read it first on gentoo-dev. The ebuild is not affected. The checksum in the ebuild will fail against the compromised tarball.

  22. Re:Just a Thought to prevent this.. by yatest5 · · Score: 5, Funny

    If there would be some configure/make environment that prevents or asks before outgoing connections and checks for possibly dangerous commands, that are unusual to call upon a ./configure run, wouldn't that prevent things like this to happen again?


    Yes, I recommend having the installation banned from creating / deleting / running any files.

    --
    • Mod parent up! [a] by Anonymous Coward (Score:5) Thurs, June 31, @13:37
  23. Open Source PKI Needed? by carbon60 · · Score: 4, Interesting

    It seems like we need to start using a "web-of-trust" based PKI solution, like OpenPGP. And educating users to actually check the signatures!!!

    On a related note, does Debian use anything to prevent this from happening? I for one don't worry too much when doing an update, maybe I should...

    --

    --
    Adam Sherman
    Freelance Geek
    1. 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.

  24. Re:Why not hack the md5 checksums? by disappear · · Score: 3, Interesting
    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?

    This is a solved problem. Red Hat, for example, GPG signs the MD5SUM file. So you can verify that the person who created the MD5SUM was authorized to do so.

  25. Re:Since its only a build issue... by Bostik · · Score: 3, Informative

    This was just one type of trojan. Some others could go dormant for several hours before contacting the world outside. Simply "building the binaries with plug off the wall" is not a solution. It's a knee-jerk reaction and still at fault. The correct way is to check the package against a MD5sum or (preferably) GPG signature - and if possible, these should be at a different machine on a different network from the tarballs.

    On the other hand, just looking at the trojan source quickly, it looks very much like a slightly evolved version of those found in irssi, BitchX, dsniff and fragroute configure scripts. This has already been noted by some other individual here as well. See his post for links.

    --
    There is no such thing as good luck. There is only misfortune and its occasional absence.
  26. Prescient Alan Cox / Theo exchange by wfrp01 · · Score: 5, Interesting

    Check out this little snippet (the whole message can be found on lwn.net) from an email from Theo:

    We've been trying to warn vendors about 3.3 and the need for privsep, but they really have not heeded our call for assistance. They have basically ignored us. Some, like Alan Cox, even went further stating that privsep was not being worked on because "Nobody provided any info which proves the problem, and many people dont trust you theo" and suggested I "might be feeding everyone a trojan" (I think I'll publish that letter -- it is just so funny).

    Please do publish that letter, Theo. That would be very interesting.

    PU

    --

    --Lawrence Lessig for Congress!
  27. I think it's okay now by hardave · · Score: 5, Interesting

    I'm one of the admins for SunSITE Alberta which houses openbsd.org. I just checked the file currently available for download and it seems to be clean. The MD5SUM matches up, as well as extracting and looking at the source bf-test wasn't present.

    This really sucks since I woke up only like 10 minutes ago and find that the most downloaded file from your site may be trojaned. I have a distinct feeling that the rest of my day isn't going to be much better.

  28. Re:203.62.158.32 by Bostik · · Score: 3, Informative

    But in this circumstance, I don't believe it is the case. The trojan connects to port 6667, which is usually ircd. Outgoing connections to irc servers are not exactly uncommon in those boxes that run any kind of flavour of *nix. Hence, it's not a connection that really attracts attention by itself. It looks like a connection to a stand-alone ircd in netstat reading. Also, because irc is so common service to use, the firewall setups are likely to allow this through.

    The other end of that connection, however, was more than likely running something totally unrelated to irc. After all, the connection itself is somewhat like a backward rsh. (I believe it actually bears the name "bindshell"...) This was a very basic case of trojan: install a backdoor that calls home and allows to execute commands remotely.

    --
    There is no such thing as good luck. There is only misfortune and its occasional absence.
  29. Re:Not the fault of OpenBSD? by Tuzanor · · Score: 4, Informative

    Actually, they aren't the ones running the box. openbsd.org and openssh.org (including the main ftp servers) are run on Solaris at the University of Alberta in Calgary. This is because the Universtity has offered free bandwidth, and for projects as large as openbsd/openssh, free bandwidth is a godsend.

  30. 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.
  31. FYI: Gentoo OK by jehreg · · Score: 3, Interesting
    Gentoo is a source-only distribution. This trojan has not affected Gentoo since the MD5 digest is checked before compilation occurs. I just checked, the MD5 digest included in the "portage tree" is the correct one, and portage has detected the change.

    End result: no one in Gentoo has been able to compile/emerge openssh for the last few days.

    Which is good :-)

  32. blocking network traffic by mborland · · Score: 3, Informative
    This sort of a problem is a proof of defense-in-depth practices. Most people have pointed out the value of creating (and checking) gpg signatures, but in addition if you use iptables on the target machine (or a firewall elsewhere) your security is improved quite a bit. If you impose stringent rules, you reduce the possibility that trojaned code will be able to contact-the-mothership/scan/DoS. If you log such unusual activity, then it will be pretty obvious that something has gone wrong.

    In particular, if the machine in question is a server (usually the reason you have SSH on a box), you should make every possible effort to remove outgoing traffic. There's usually no reason for a server to create outgoing connections to the internet, and if it needs to connect to any specific local resources (e.g. a database machine), limit the iptables/routers appropriately.

  33. Re:203.62.158.32 by adam613 · · Score: 3, Informative

    Actually, that's not true. (someone correct me if I'm wrong on this, but I think I'm close). When you compile gcc, it first compiles a version of itself (stage 1) using your current gcc. Then it uses stage 1 to compile itself again, resulting in stage 2. Finally, it compiles itself one more time using stage 2, resulting in stage 3. The build succeeds if and only if stage 2 and stage 3 are identical. This process ensures that your final gcc is free from any defects in the original gcc. Once you have a clean gcc, you can rebuild the rest of your system using it.

    Take a look at www.linuxfromscratch.org to see how this works for an entire system.

  34. Rebuilding from source, and paranoia by valdis · · Score: 3, Informative

    Step 1: Read Ken Thompson's Turing Award lecture "On Trusting Trust"

    http://www.acm.org/classics/sep95/

    Step 2: Decide for yourself if you're ready for the tinfoil-helmet brigade.

    Step 3: Type 'make world' if you dare.

  35. Re:203.62.158.32 by dossen · · Score: 3, Informative

    Recompiling the compiler doesn't do anything to rid you of trojan code/back doors. If you need to ask why, take a look at "Reflections on Trusting Trust" by Ken Thompson, and the description of a back door in the jargon file.

    The short story is, that the compiler decides what to output. So you have to trust your compiler.

    The reason for the recompiling of gcc is something else entirely: It is to allow the source code of gcc to rely on gcc, and to allow an optimized compiler to be created.
    For additional information consult a good book on compiler writing.

  36. Re:GnuPG a good idea by Abcd1234 · · Score: 4, Informative

    Actually, the code wasn't "signed" in the cryptographic sense. The code was checksummed, and that checksum showed there was a problem. However, there is nothing stopping someone from modifying the checksum and making the archive appear legit.

    Real cryptographic signing, like that mentioned in the grandparent post, involves hashing the tarball using a strong hash, and then encrypting that hash using the private key of the signer. Then, any person can retrieve the public key of the signer and verify that the "signature" is legitimate by attempting to decrypt the hash (this is probably not strictly correct with the way things really work, but the concept is, AFAIK, correct). The point is that the only person who can "sign" the tarball is limited to only legitimate people (or organizations). So, if the signature for the tarball is valid, you can guarantee it was signed by someone you trust, and so you can trust the code.

  37. 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.
  38. 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
  39. Re:Bad news and Good news by glwtta · · Score: 5, Informative
    yes, very "insightful":

    And it looks like they're not "eating their own dog food," and eating Sun dog food instead

    did you ever think there might a reason for that?

    then you can't trust a web server to give you a web page with an unaltered MD5 sum. Surely this is common sense?

    I am not sure, but this just might be the reason why systems like BSD ports and Gentoo portage store the MD5 sums in the ports trees, and don't in fact get them from websites.

    The real solution is digital signatures (i.e. an MD5 sum encrypted with a private key).

    WOW! what an original and fresh solution! you sir, are some sort of genious for coming up with this.

    congratulations, you've managed to regurgitate several of the things that have been said, literally, hundreds of times today already. I think the Society for Prevention of Cruelty to Dead Horses might have a bone to pick with you.

    --
    sic transit gloria mundi