Slashdot Mirror


Homeland Security Uncovers Critical Flaw in X11

Amy's Robot writes "An open-source security audit program funded by the U.S. Department of Homeland Security has flagged a critical vulnerability in the X Window System (X11) which is used in Unix and Linux systems. A missing parentheses in a bit of code is to blame. The error can grant a user root access, and was discovered using an automated code-scanning tool." While serious, the flaw has already been corrected.

49 of 517 comments (clear)

  1. OpenBSD fixed on Jan. 21, 2000 by Anonymous Coward · · Score: 4, Informative

    Check the CVS server. OpenBSD 0wns again!

    1. Re:OpenBSD fixed on Jan. 21, 2000 by LurkerXXX · · Score: 5, Informative

      OpenBSD fixes 'security holes' all the time, without even knowing it. If code looks 'dirty' (hard to read), they will often rewrite it so that it's easier to audit for bugs in the future. Most of the time when they fix a 'hole', they never actually spotted the hole. They were just cleaning up messy looking code. A few years later (like in this case) it will often turn out that there was a security hole hidden in the mess.

      FYI, they do often send the cleaned version back to the codes maintainers, but they can't force them to use the re-arranged code, or port it to other systems. Sorry.

    2. Re:OpenBSD fixed on Jan. 21, 2000 by dietrollemdefender · · Score: 5, Funny
      If code looks 'dirty' (hard to read), they will often rewrite it so that it's easier to audit for bugs in the future.

      That is one brilliant policy! Kudos to whomever implemented that!

      It reminds of an incedent about 12 years ago. A bunch of us entry level programmers were sitting around and this one guy pipes up and says "Look! I wrote an entire function (it was C) in one line!" He did, too. It was one of those 'for' loops with a 'while' and a bunch of things in one line. It was impossible to read. I just shook my head and said, "If there's a bug in that code, and I get assigned to it, I'm coming for you!"

    3. Re:OpenBSD fixed on Jan. 21, 2000 by strabo · · Score: 5, Funny
      March 10 would be more correct

      More specifically, March 10th of 2006. Seven weeks ago.

      Best part was the CVS log:

      Fri Mar 10 17:29:51 2006 UTC (7 weeks, 4 days ago) by deraadt:
      proper geteuid calls because suse hires people who mistype things
    4. Re:OpenBSD fixed on Jan. 21, 2000 by Nutria · · Score: 5, Interesting
      "Look! I wrote an entire function (it was C) in one line!" He did, too. It was one of those 'for' loops with a 'while' and a bunch of things in one line. It was impossible to read.

      That reminds me of the Kernighan quote, which I heartily agree with:
      "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."


      --
      "I don't know, therefore Aliens" Wafflebox1
    5. Re:OpenBSD fixed on Jan. 21, 2000 by Nutria · · Score: 5, Insightful

      Then if I want to do my own debugging, I should only put half my effort into coding!

      Funny, and almost right.

      Put all your brains, but half of your cleverness into coding.

      IOW, use all your intellect to simplify the code, and only be "clever" (that's a mild pejorative if you haven't figured it out by now) when there's no other way to accomplish the task.

      I have to admit, though, that I was young once, and foolish, and thought it was the height of brilliance to write code (especially C, but even Pascal) in as few lines as possible.

      --
      "I don't know, therefore Aliens" Wafflebox1
  2. Related news by LiquidCoooled · · Score: 5, Funny

    In related news, the Department of Homeland security has notifed 3497 people where their missing TV remote control is to be found, where your wife was until 3am last Thursday and have completed a record number of soduku puzzles in newspapers around the country.

    Government officials were unwilling to cite their sources for this information instead choosing to simply say "we are watching you".

    --
    liqbase :: faster than paper
    1. Re:Related news by rbochan · · Score: 5, Funny

      "This message brought to you by AT&T"

      --
      ...Rob
      The American Dream isn't an SUV and a house in the suburbs; it's Don't Tread On Me.
    2. Re:Related news by PlusFiveTroll · · Score: 4, Interesting

      Should this be modded funny or sad?

    3. Re:Related news by Bush+Pig · · Score: 3, Insightful

      What I'd really like to know is how come the code even compiled if it was missing a closing parenthesis somewhere. None of mine ever does in that circumstance.

      --
      What a long, strange trip it's been.
    4. Re:Related news by x2A · · Score: 4, Funny

      oh yeah, it was also missing the opening one, but it sounds like a bigger danger if they only point out the closing one was missing (OMG, it was left open!) ;-)

      --
      The revolution will not be televised... but it will have a page on Wikipedia
    5. Re:Related news by mattwarden · · Score: 5, Informative

      You're misinterpreting what the problem was. It was a change from this:

      if (getuid() == 0 || geteuid != 0)

      to this:

      if (getuid() == 0 || geteuid() != 0)

    6. Re:Related news by prockcore · · Score: 4, Insightful


      You're misinterpreting what the problem was. It was a change from this:

      if (getuid() == 0 || geteuid != 0)

      to this:

      if (getuid() == 0 || geteuid() != 0)


      This is why stuff should compile *without warnings*. It drives me nuts to compile something and see hundreds of warnings spit out.

      (And yes, gcc will throw a warning if you compare a function pointer with 0 instead of NULL)

    7. Re:Related news by Anpheus · · Score: 3, Insightful

      They can only make your decisions for you when you use an unencrypted method of communication.

    8. Re:Related news by Reverend528 · · Score: 5, Funny
      This is why stuff should compile *without warnings*. It drives me nuts to compile something and see hundreds of warnings spit out.

      It drives me nuts too. That's why i use the -fsyntax-only option whenever I compile anything. It gets rid of the warnings so you know your code is safe!

    9. Re:Related news by SleepyHappyDoc · · Score: 3, Funny

      In related news, the Department of Homeland security has notifed 3497 people where their missing TV remote control is to be found

      No, no, that's a flaw in X10, not X11. That missing remote behaviour is an undocumented feature.

      --
      Stasis is death. Embrace change.
  3. Only one? by Anonymous Coward · · Score: 3, Interesting

    They uncovered only one flaw? Sheesh.

    1. Re:Only one? by Frosty+Piss · · Score: 4, Funny
      They uncovered only one flaw? Sheesh.

      Only one that they are telling us about...

      --
      If you want news from today, you have to come back tomorrow.
  4. Way to go, boys! by Junior+J.+Junior+III · · Score: 5, Funny

    Kudos to the heroes who painstakingly reinserted the missing parenthesis!

    --
    You see? You see? Your stupid minds! Stupid! Stupid!
  5. Any word on the fix? by FirstTimeCaller · · Score: 5, Funny

    A missing parentheses in a bit of code is to blame...the flaw has already been corrected.

    Any word on exactly what the fix was?

    --
    Wanted: witty unique signature. Must be willing to relocate.
    1. Re:Any word on the fix? by RLiegh · · Score: 3, Funny

      Would half a parenthesis be considered a word?

    2. Re:Any word on the fix? by RemovableBait · · Score: 5, Funny
      * <-- Joke
      * <-- Your Head
  6. Success by mytmouse · · Score: 3, Funny

    Finally Homeland security has done something noteworthy. I'm glad this benefits the X11 community.

    --
    the answers you get depend on the questions you ask.
  7. Re:Already Corrected? by Vyvyan+Basterd · · Score: 5, Insightful

    Why are you running X11 on your servers?

  8. watch out for their patches, though by Anonymous Coward · · Score: 5, Funny
    #define ) ); Install_Patriot_PhoneHome();
  9. Little known fact... by Junta · · Score: 4, Funny

    X11 is actually written entirely in LISP, and therefore there are too many parentheses for a mere mortal to ever get straight.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  10. OS X? by nursegirl · · Score: 3, Interesting

    Any word on whether this vulnerability is a risk for those using x11 within osx? TFA mentioned that the X windowing system shipped with OS X without stating what level of risk exists.

    1. Re:OS X? by Carnildo · · Score: 4, Informative

      OSX ships XFree86 4.3.0, which is not vulnerable.

      --
      "They redundantly repeated themselves over and over again incessantly without end ad infinitum" -- ibid.
  11. Re:I wonder by tcopeland · · Score: 3, Funny

    > I wonder if Miles Papazian discovered the flaw
    > by reading the binary or by utilizing a machine-coded matrix?

    I don't know, but I bet Chloe O'Brian is lurking nearby. And she's probably scowling.

  12. Re:Already Corrected? by Anonymous Coward · · Score: 5, Funny

    Maybe it's an X11 server.

  13. Re:Already Corrected? by wobblie · · Score: 3, Insightful

    uh, you display it somewhere else.

  14. The compiler just does what you ask. by EmbeddedJanitor · · Score: 4, Informative

    if you said a + b * c but you really wanted (a + b) * c the compiler won't bleat.

    --
    Engineering is the art of compromise.
  15. Not Quite by mattwarden · · Score: 5, Funny

    Actually, it was not a missing parenthesis, but a missing parenthetical.

    double r;
    r = ( (double)rand() / ((double)(RAND_MAX)+(double)(1)) );
    if ( r < 0.5 ) gotroot(true);

    And the patched code:

    double r;
    r = ( (double)rand() / ((double)(RAND_MAX)+(double)(1)) );
    if ( r < 0.5 ) gotroot(true); (just kidding!)
  16. Re:So does this mean? by AtomicX · · Score: 5, Insightful

    In most cases the compiler will catch errors caused by typos and omissions, but it is perfectly possible to write code containing typos or missing characters which are still valid.

    I had a quick look on Coverity's website and this appears to be the relevant line of code:

    - if (getuid() == 0 || geteuid != 0)
    + if (getuid() == 0 || geteuid() != 0)

    In the case of the first line, "geteuid != 0" is valid C code but checks whether or not the address of the geteuid function is 0.

    The second line is what the programmer intended to write, which calls the geteuid function and checks the value returned by that function.

    The problem (if there is one) lies with the language, not the compiler, since both of the above lines are legal C code.
    Solutions to this kind of problem probably involve both a movement towards higher level languages (which are typically more verbose and don't allow low-level memory manipulation), and more extensive static code analysis. In the case of Xorg and the kernel, moving to a higher level language isn't really an option (not yet, at least).

  17. Re:Sometimes gentoo is a pain. by Anonymous Coward · · Score: 5, Insightful

    The impression I get is that it shouldn't be easily exploitable. By default, Gentoo (and any sensible distro) configures X11 to disable remote connections. Also, you should have some sort of firewall blocking the relevant ports anyway. If it is really exploitable, the attacker would probably need access to the machine anyway (at which point, you're largely already screwed).

    Not reading the article doesn't seem to be much of a problem. It's really not very clear. For example, is this a problem with X.org X11 specifically? Is Apple's X11.app affected? The article just says the problem is with "The X Window System", without mentioning any particular implementations.

    It took some digging to find the actual advisory:

    http://lists.freedesktop.org/archives/xorg/2006-Ma y/015136.html

  18. Missing *pair* of parentheses by Chirs · · Score: 4, Informative

    The fix was posted before, but the problem was that someone used "geteuid" rather than "geteuid()".

    This results in making use of the function address rather than the return value of the function, which could cause difficulties.

  19. This is not a remote root vunerability by Technician · · Score: 4, Insightful

    Please note that this exploit is for the local user only. If you are the only user on your Apple or Nix box, then this is a non-news item. However if the BSA, RIAA, MPAA, or Dept of Homeland Security has taken your box and wants root, then you might have a problem. ;-)

    --
    The truth shall set you free!
  20. Missing the point..... by TheDukePatio · · Score: 5, Interesting
    I see a ton of comments mod'd Funny, but what I'm surprised folks haven't focused on yet is the fact that it was found in OSS. The reason they're able to find, report, and get it fixed in a week is the fact that it's OSS. It's understandable that the DoHS is going to want to do a security audit on things like this.

    I wonder how many potential security holes Coverity's uncovered by scanning Windows source....oh wait....they can't. Well I'm sure if they signed an NDA they could tell M$ and get it fixed in a....um...err...sorry, you'll have to wait for the next patch cycle.

    --
    To Alcohol! The cause of, and solution to, all of life's problems.
    1. Re:Missing the point..... by ipfwadm · · Score: 4, Interesting

      On the other hand, because its OSS now all of the machines that remain unpatched have an exploit that is not only known, but but publicized by the developer, with diffs showing *exactly* what line of code the error is on.

      While I hate to sound like all the other OSS apologists that have posted so far ("yeah there's an exploit, but think of how many we could find if we could run it on the Windows source!" and other such tripe that ignores the fact that a serious bug was found in OSS software), your argument is a bunch of crap. You're basically saying that exploits in closed-source software are unknown and unpublicized, which is ridiculous.

      As for your Apache example, it would be just as simple to see what version of IIS a machine is running and look through MS KB to find the known exploits against it. Or look at bugtraq. Or anywhere else on the Internet. Just because the source is a secret doesn't mean the details of the available exploits are too.

      Oh and knowing the line of source code on which that the error exists is entirely irrelevant to the discussion -- having that knowledge doesn't make using an exploit any easier or more difficult. It may assist in developing new exploits, but when attempting to use one that has been found, that knowledge is superfluous.

  21. Wow. Homeland Security.... by tomq123 · · Score: 5, Funny

    is getting close to being able to do what they portray on 24.

    Jack: I'm running out of time. I need that salelite image.
    Chloe: I opened a socket into a NASA server and retasking the satelite.
    Jack: Great, download the image to my PDA.
    Chloe: I need your IP address.
    Jack: 1.2.123.129
    Chloe: I'm having some trouble. I'm hacking into a secure server at CTU, and sending the image to your PDA.
    Jack: I've got it. Thanks Chloe.
    Chloe: Whatever...

  22. It all depends... by mistergin.net · · Score: 3, Funny

    Depends,

    Have you paid your Moses Fee?

    (let my packets go....) [as sung to 'let my people go']

    --
    Less Talk. More Stab.
  23. UIDs by r00t · · Score: 5, Informative

    The effective UID (euid) is changed when you run a setuid app, while the real UID (uid in this case, or ruid) is not.

    The effective UID is normally associated with permission to access files. Well, Linux actually uses the filesystem UID (fsuid or fuid) for that, but that one nearly always tracks the effective UID for compatibility.

    There is also a saved UID (suid or svuid) that is helpful for apps that need to swap UIDs back and forth. It's not used for anything else.

  24. the usual confusion by penguin-collective · · Score: 5, Insightful

    There can't be a "missing parenthesis in X11" because X11 is not a piece of code, it's a protocol. This vulnerability only affects the X.org and XFree86 implementations of X11; there are many other implementations that are not affected.

    It's pretty sad that Windows and Macintosh have conditioned people to think that every window system is just a piece of code; the notion that a window system could be an API standard with multiple implementations doesn't seem to occur tothem.

  25. Mac OS X Tiger by themadplasterer · · Score: 3, Interesting

    Tiger shipped with (X11 1.1 - XFree86 4.4.0) and X11R6.9.0 and X11R7.0.0 are forked from that. So it could well affect Mac OS X. If it does it will be interesting to see how long it takes Apple to provide an update if at all, given that it's open source

  26. Re:This is not a remote root vunerability by acoopersmith · · Score: 3, Informative

    The exploit mentioned in this article cannot be exploited by a user who isn't logged into your system - you have to be able to run the Xorg command with certain options. See X.Org's advisory at http://lists.freedesktop.org/archives/xorg/2006-Ma rch/013992.html

  27. Re:Already Corrected? by Just+Some+Guy · · Score: 3, Funny
    Is LinuxUpdate.linux.com going to send this out on Tuesday automatically and reboot my machine?

    $ dig -t cname LinuxUpdate.linux.com
    LinuxUpdate.linux.com. 86400 IN CNAME ftp.us.debian.org.
    LinuxUpdate.linux.com. 86400 IN CNAME portsnap.freebsd.org.
    LinuxUpdate.linux.com. 86400 IN CNAME ftp.ubuntu.com.

    $ dig -t txt LinuxUpdate.linux.com
    LinuxUpdate.linux.com. 86400 IN TXT "Tonight, she comes."

    Yes.

    --
    Dewey, what part of this looks like authorities should be involved?
  28. Re:I don't understand the intention of the fixed c by acoopersmith · · Score: 3, Insightful

    It's in code that allows you to do things like load code modules from other paths, so it's only allowed if you're already root or not running setuid-root. (It should probably check that you're not running setuid at all, but there's no real point having Xorg setuid to anyone but root, so no one has added that check.)

  29. Critique... by jd · · Score: 4, Interesting
    1. Knowing the line won't help you figure out the exploit
    2. Whether anyone tells you about a bug or not, you're always capable of scanning source - or even binaries - in search of unknown exploits
    3. You knowing about a bug doesn't alter the odds of "Them" knowing about a bug - it only alters the odds of you fixing it
    4. X11 bugs are rarely externally exploitable, as not many people run X sessions over the public internet and therefore those ports will be blocked at the corporate (or personal) firewall
    5. The mathematical model of conflict ("Game Theory") only has a solution (ie: win no matter what the opponent does) when both sides know absolutely everything, ergo the only way to establish a sane IT security policy is to assume the attacker knows all the defects and exploits that exist, whether they are published or not


    That last one makes things tough. How can you have security when everything is known? Well, in practice that is the only context security is even possible. "Security through obscurity" really means "we don't know what our opponents know and we're not even sure what we know". If, however, you assume that your opponents know everything then you don't take shortcuts. You plan for contingencies, you have fallback positions, you have not just a plan but a roadmap of possibilities and how to deal with them.


    (At least, for any scenario too complex to actually have a complete solution for. For simpler problems, such as a chess puzzle or - for the past decade - the entire game of draughts, it is possible to map a complete, guaranteed winning strategy that will work no matter what the opponent does. Such a solution exists for the complete game of Chess and indeed for the complete game of Go, but has not yet been found. For any given computer system, such a solution must also exist for the operator/admin, but the chief problem has always been to get them to bother even putting the bits of solution that are known in place.)

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)