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.

96 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 zukakog · · Score: 2, Funny

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

    6. Re:OpenBSD fixed on Jan. 21, 2000 by Alioth · · Score: 2, Insightful

      The truth sometimes hurts. Theo de Raadt just doesn't dress it up. I wouldn't hire Theo as a diplomat (well, not unless I wanted to actually start a war), but I would hire him as someone who can write secure code. I don't care if he has no social skills; I'm after secure code. That's why we use OpenBSD for security critical things.

    7. 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
    8. Re:OpenBSD fixed on Jan. 21, 2000 by Kjella · · Score: 2, Insightful

      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.

      And the collorary to that: If you are (trying to be) clever, leave comments about what you're doing. Whoever might have to review/fix your code will greatly appriciate it. Remember, that person might be YOU. While I still try to be clever a little too often, it makes it incredibly much easier to fix.

      --
      Live today, because you never know what tomorrow brings
    9. Re:OpenBSD fixed on Jan. 21, 2000 by stoborrobots · · Score: 2, Informative

      It sounds like you're thinking of the Underhanded C Contest... The 2005 results look something like what you're describing... :-)

      HTH. Cheers.

  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 dimator · · Score: 2, Funny

      Can they get on the missing socks situation now, or what?

      --
      python -c "x='python -c %sx=%s; print x%%(chr(34),repr(x),chr(34))%s'; print x%(chr(34),repr(x),chr(34))"
    6. 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)

    7. Re:Related news by fbjon · · Score: 2, Insightful

      It's not always matching because getuid != geteuid.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    8. Re:Related news by nuzak · · Score: 2, Insightful
      --
      Done with slashdot, done with nerds, getting a life.
    9. Re:Related news by online-shopper · · Score: 2, Informative

      Doh! I missed the euid. please mod the above post to oblivion

    10. Re:Related news by Columcille · · Score: 2, Informative

      Check again, getuid() and geteuid() are not the same, so:

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

      means something like if the real user id executing the process is 0 (root), or if the effective user id of the process is not 0 (root), then execute the following code.

      See here and here.

      I'm not quite sure what the difference is between the real and the effective user id, perhaps someone can enlighten us.

      --
      I love my sig.
    11. 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)

    12. Re:Related news by _Sprocket_ · · Score: 2, Funny

      Just because the NSA is listening to you, doesn't mean they're gonna make your decisions for you.

      (that's the job of Congress and industry trade groups)

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

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

    14. 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!

    15. 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.
    16. Re:Related news by w9ofa · · Score: 2, Informative

      You missed the point. The value of NULL is 0, but what is a NULL reference?

      Conventional C programmers (not C++) define NULL as (void *) 0x0.

    17. Re:Related news by Isotopian · · Score: 2, Funny

      I didn't even know there was a 'sad' mod! Can we apply it to all the posters who make Yakov Smirnov Jokes?

      --

      It's poetry with a beat behind it! And guns! They're like beatniks with automatic weapons.

    18. Re:Related news by cgenman · · Score: 2, Funny

      You can have my decision-making encryption power when you pull it from my cold... dead... Hey! What are you doing? It was just a metaphor! A metaphor! Wait! Noooo!

      $#$#%... [signal lost]

    19. Re:Related news by Schraegstrichpunkt · · Score: 2, Informative
      That better not be true... Since ANSI C says that NULL is 0.

      I don't know about ANSI, but ISO/IEC 9899:1999(E) (a.k.a. "C99"), under section 7.17 "Common definitions <stddef.h>" states:

      1 The following types and macros are defined in the standard header <stddef.h> . Some are also defined in other headers, as noted in their respective subclauses.

      ...

      3 The macros are

      NULL
      which expands to an implementation-defined null pointer constant;
      Under section 6.3.2.3 "Pointers", the "null pointer constant" is defined as follows:
      3 An integer constant expression with the value 0, or such an expression cast to type void * , is called a null pointer constant. If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed to compare unequal to and object or function.
  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 metroplex · · Score: 2

      Reinserting the parenthesis, duh

      --
      "Words of wisdom: drop that zero and get with the hero" -- Vanilla Ice
    2. Re:Any word on the fix? by RLiegh · · Score: 3, Funny

      Would half a parenthesis be considered a word?

    3. Re:Any word on the fix? by RemovableBait · · Score: 5, Funny
      * <-- Joke
      * <-- Your Head
  6. Re:Here is the actual flaw: by eln · · Score: 2, Funny

    Shouldn't that be:

    (X11 sucks monkey cock

  7. 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.
  8. I wonder by kevin_conaway · · Score: 2, Funny

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

    1. 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.

  9. Re:Already Corrected? by Vyvyan+Basterd · · Score: 5, Insightful

    Why are you running X11 on your servers?

  10. watch out for their patches, though by Anonymous Coward · · Score: 5, Funny
    #define ) ); Install_Patriot_PhoneHome();
  11. 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.
  12. 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.
  13. Easy by mobby_6kl · · Score: 2, Funny

    If the compiler doesn't have a problem with unmatched parentheses, to prevent any such problems in the future, simply insert) closing) parentheses) instead) of) spaces).

  14. Advisory by Anonymous Coward · · Score: 2, Insightful

    If you're wondering, here is the relevant SUSE security advisory from 21.3 - http://www.novell.com/linux/security/advisories/20 06_16_xorgx11server.html

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

    Maybe it's an X11 server.

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

    uh, you display it somewhere else.

  17. 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.
  18. 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!)
  19. 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).

  20. Re:So does this mean? by teslar · · Score: 2, Funny

    Well, from TFA: "This was caused by something as seemingly harmless as a missing closing parenthesis"

    So no, it is indeed just a closing paranthesis that is missing. Why exactly that bloke considered this 'seemingly harmless', I don't know though... that is rather like saying "The car crash was caused by something as seemingly harmless as a severed brakeline."

  21. 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

  22. 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.

    1. Re:Missing *pair* of parentheses by acoopersmith · · Score: 2, Informative
      Actually, gcc never issued a peep about this code. Try it yourself - compile this with gcc -Wall:
      #include <stdlib.h>
      #include <unistd.h>

      int main()
      {
      if (getuid() == 0 || geteuid != 0) {
      return 1;
      } else {
      return 0;
      }
      }
      gcc 3.4.3 says all is fine. You can make it complain if you change geteuid != 0 to !geteuid - then it points out "warning: the address of `geteuid', will always evaluate as `true'"
  23. Re:Already Corrected? by nagora · · Score: 2, Insightful
    Servers should NOT be running X servers.

    That's gonna ruin someone's LTS system.

    TWW

    --
    "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
  24. 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!
  25. Re:Sometimes gentoo is a pain. by Carnildo · · Score: 2, Informative

    If you're running Gentoo stable, then you're safe: you've got Xorg 6.8.2, which is not vulnerable.

    If you're running ~x86, then you've got the vulnerable version. It's a local exploit, one that is trivially simple for an experienced programmer to use.

    --
    "They redundantly repeated themselves over and over again incessantly without end ad infinitum" -- ibid.
  26. Re:Sometimes gentoo is a pain. by iabervon · · Score: 2, Informative

    All of the affected versions are masked for testing under Gentoo, so chances are that you're not using an affected version anyway. In any case, it's evidently trivial for a local user starting an xserver to cause it to execute arbitrary code, but there's no way to attack a running server locally or remotely.

  27. 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.

  28. Old news. by Homestar+Breadmaker · · Score: 2, Interesting

    This is from march, why is everyone freaking out now?

  29. Another score for open source! by MoxFulder · · Score: 2, Insightful

    The advantage of open source shines through once again! This couldn't have happened with MS Windows, that's for sure... without access to the source code, this bug couldn't have been discovered, let alone fixed so quickly.

    (And yes, I know that some gov't agencies have a deal to view the Windows source code, but there are WAAAY fewer eyeballs looking at it, and from what I've heard the code is a big badly documented mess.)

    1. Re:Another score for open source! by LegendLength · · Score: 2, Funny

      Microsoft runs these bug-checker-programs on their code all the time.

      Excluding Outlook Express I guess.

    2. Re:Another score for open source! by toadlife · · Score: 2, Funny

      "Excluding Outlook Express I guess."

      Perhaps it's part of their market effort to get people to uprade to Outlook.

      --
      I don't always use unix-like operating systems; but when I do, I prefer FreeBSD.
    3. Re:Another score for open source! by sorak · · Score: 2, Funny
      The advantage of open source shines through once again! This couldn't have happened with MS Windows, that's for sure... without access to the source code, this bug couldn't have been discovered, let alone fixed so quickly.

      (And yes, I know that some gov't agencies have a deal to view the Windows source code, but there are WAAAY fewer eyeballs looking at it, and from what I've heard the code is a big badly documented mess.)


      Yeah, but Windows is still safer, because the useful bugs are hidden in with all these other bugs. In fact, it's sometimes hard for a hacker to get to the exploit, because, first he runs into what I like to call "the blue screen OF FREEDOM!"
  30. I just saw a story.. by ModernGeek · · Score: 2, Funny

    ..I just saw a story on digg (washes mouth out with pee to get bad taste out of my mouth), and noticed that the FAA just announced they will be running linux to track flights. Maybe there is a tie in-between this find and that announcement?

    --
    Sig: I stole this sig.
  31. 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...

  32. Re:This is not a remote root vunerability by tokabola · · Score: 2, Insightful

    AFAIK this exploit can be used over the net, but only if you've enabled remote logins in your Xconf. I'm not aware of any distro that does that by default, and the Xconf "sample" that comes with XFree86 or Xorg both have remote logins disabled.

    I realize that it's too much too assume that anyone geek enough to enable remote X sessions is also geek enough to protect his system adequately, but most of the time that will be the case.

    --
    Open Source for Open Minds
  33. Re:So does this mean? by Anthony+Liguori · · Score: 2, Interesting

    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)


    I think we can both agree Python is a higher level language. And guess what:

    import os

    if os.getuid() != 0 or os.geteuid = 0:

    is completely valid. It's not high level vs low level languages here that's at issue. It's static verses dynamic typing and more specifically, strict verses weak static typing. If 0 wasn't treated so specially in C (it's the only numeric literal that's directly comparable to a pointer) this wouldn't be an issue.

    Unfortunately, C++ made it even worse since the standard mandates that NULL is defined as:

    #define NULL 0

    Instead of at least:

    #define NULL (void *)0

  34. 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.
  35. 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.

  36. Re:So does this mean? by dotgain · · Score: 2, Informative
    That's why TFA said parentheses , which is the plural of parenthesis.

    Incidentally, that's the word you should have used too.

  37. Where was the warning? by The+Pim · · Score: 2, Interesting
    There are a number of interesting issues with this bug and how it's being reported.
    • Never mind that the bad code is valid C, it's insane that it didn't generate a warning. I hope GCC has the option, and security sensitive code should be built with as many warning enabled as possible.
    • Code that's conditional on "whether I'm root" is a hole waiting to open. Must better to have a separate wrapper that is setuid and accepts a constricted set of options, then calls the real program (which is not setuid).
    • Given that X is a network service, most commonly run on single-user machines, a local root vulnerability (while egregious) is hardly a "worst-case scenario".
    • This appears to be an effective use of government funds.
    --

    The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.
  38. Re:Already Corrected? by cortana · · Score: 2, Insightful

    In which case it won't be running the X server, which is the program in which this flaw resides. :)

  39. 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.

    1. Re:the usual confusion by haroldhunt · · Score: 2, Insightful

      Uhh... coming from someone with 5 years of experience in the X Window System, your statement that X11 refers to a protocol and not a codebase is overly pedantic and not truly reflective of reality.

      The name 'X11' effectively refers to a code base because the 'sample implementation', which was extended for specific hardware by XFree86 and X.org, is the basis of almost all X Servers in existance. For example, Sun and HP both ship their own X Servers, but the base upon which they implemented their device-dependent code for specific video cards and input devices. Free X servers for Windows and Mac OS X both use the sample implementation (X.org to be specific). Commercial X Servers for Windows all seem to use the sample implementation as well. The only non-sample implementation X Server that I know of is WeirdX, an X Server written entirely in Java, which implies that everything would have to have been rewritten.

      Harold

  40. 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

    1. Re:Mac OS X Tiger by EMR · · Score: 2, Interesting

      Home land security is WAY behind on things OR eweek is way behind on things. This was fixed back in March and ONLY affects X.org 6.9 adn 7.0 so Mac OS X is unaffected.

      https://bugs.freedesktop.org/show_bug.cgi?id=6213

  41. 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

  42. Show me the source... by DusterBar · · Score: 2, Interesting
    While this is unfortunate that there was such a bug, there is something to be learned here, beyond the fact that any software can have such flaws:

    Homeland Security was able to do the code audit on X11.

    Maybe that really should be written as, because the source code was publicly available, Homeland Security was able to do this. How many of these types of faults exist in closed source software that no outside group had the chance to dig into like with X11 or OpenBSD or...

  43. I don't understand the intention of the fixed code by gfim · · Score: 2, Insightful
    The fixed code is
    if (getuid() == 0 || geteuid() != 0) do something that only root can do
    What is the intention of this test? Allow something to be done if the real user id is zero (i.e. it is root logged in) or if the effective user id is not zero (i.e. if the program is running as setuid to somebody other than root). That doesn't make a lot of sense to me.
    --
    Graham
  44. 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?
  45. 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.)

  46. nullptr to the rescue by neutralstone · · Score: 2, Informative

    Rumor has it the ISO C++ committee is likely to pass through a proposal for a new keyword, nullptr, which will have a "magic" type "pointer-to-anything" and has the value of the null pointer constant.

    So, E.g.:

    struct A;
    int f( A* ); // #1
    int f( int ); // #2

    int m =  f( 0 ); // # calls #2
    int n =  f( nullptr ); // calls #1

    Of course, that wouldn't help in the aforementioned case.  0 will still be convertible to a pointer type as it is now; it's just that 'nullptr', being a pointer itself,  makes for a "better" conversion to a real pointer type.

    nullptr is supposed to be a non-disruptive pure extension (except for the fact that it breaks code that uses 'nullptr' as an identifier) -- meaning that it should not change the meaning of existing code.

  47. Why? by Junta · · Score: 2, Informative

    A linux terminal server need only the X libraries, not even a single instance of an X server, which generally requires elevated privileges to run. I think I've seen work to correct that, but as it stands at large an X server runs as root and has to arbitrate security, whereas X applications linked to X libraries, displaying to a thin client over the network, the server has no root level code and only the thin client filesystem/system is at any risk.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  48. Agree with the sentiment, but.... by Junta · · Score: 2, Insightful

    Unfortunately, the distros compete with the likes of Windows. As such, though technically speaking X on a multi-user system of any remote importance is a bad idea, if you shrug off X on servers Windows administrators may not like it as much. Install Red Hat or SuSE server oriented distributions and by default you still end up with a X environment. Good administrators know not to run X and it is powerful and even more convenient to run X apps remotely or inside a detachable VNC session. For small business to medium business/departmental servers, expect X servers to be the norm in the enterprise despite best practice.

    The obvious solution is X not as root, so the worst you can do is screw around with the devices X really needs access to (screw around with the graphics, and local input devices, but an administrator can still ssh and have an intact, secure system in the ways that matter)

    --
    XML is like violence. If it doesn't solve the problem, use more.
  49. Coming soon.... "Parenthesis Day" by renjipanicker · · Score: 2, Funny

    Starring Bruce Willis, of course, who assembles a crack team to go into the code and insert the missing punctuation before the world gets blown up.

  50. 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)
  51. Double bug half-fixed !!! by wtarreau · · Score: 2, Informative
    Obviously, it is still wrong :
    /* First the options that are only allowed for root */
    - if (getuid() == 0 || geteuid != 0)
    + if (getuid() == 0 || geteuid() != 0)
                        ^^
    This would grant the if statement to root and everybody else. This one
    should be applied next, otherwise the bug is still there :
    @@ -1677,7 +1677,7 @@
      }
      if (!strcmp(argv[i], "-configure"))
      {
    - if (getuid() != 0 || geteuid() == 0) {
    + if (getuid() != 0 && geteuid() == 0) {
    Willy
  52. Difference by suv4x4 · · Score: 2, Interesting

    That's the difference between closed source and open source I guess...

    Critical vulnerability in X11, missing parens are to blame, report: "missing parens in code leaves X11 vulnerable, the problem is fixed."

    --vs--

    Critical vulnerability in Windows, missing parens are to blame (but that's under NDA), report: "the incompetent programmers of the Redmont monopolist did it again, your Windows is totally open to hackers due to a bad, bad vulnerability. While we're on this, let's discuss also how OSX and Linux are infinitely cooler than Windows will ever be, and how Windows users are clueless idiots."

  53. Re:Caution: Sometimes 0 != NULL by sholden · · Score: 2, Informative

    Then the compiler is not compliant with the standard. Since it defined the constant 0 (and only the constant 0 not for example 1-1) in a pointer context as being converted to the NULL pointer at compile time. The only times 0 isn't correct is as an argument to a function with no prototype (which no one does anymore, right :) and as an argument to a varargs function call - since in both those cases there is no pointer context to trigger the conversion.

    You need a better compiler.

  54. seriously? by YesIAmAScript · · Score: 2, Insightful

    In concept, there is a separate protocol and implementation of X. But the source has been available under a very permissive license since the very beginning. Because of this, the only thing I've ever seen that was reimplemented was the server (window server), everything else has just been compiled directly from the reference sources.

    And even those window servers are compiled from sources derived from the reference sources, with patches.

    Do you actually know of any implementations of X other than the two you mentioned? I tried to search for some and couldn't find any.

    --
    http://lkml.org/lkml/2005/8/20/95