Slashdot Mirror


Multiple Security Holes In Ruby 1.8, 1.9

ruphus13 notes a six-pack of serious vulnerabilities discovered in Ruby by a member of Apple's security team, Drew Yao. Patches are linked from the ruby-lang.org advisory. "With the following vulnerabilities, an attacker can lead to denial of service condition or execute arbitrary code... These vulnerabilities are likely to crop up in just about any average ruby web application. And by 'crop up' I mean 'crop up exploitable from trivial user-specified parameters.' It's not hard to begin imagining cases where Ruby/Rails programmers use code similar to the samples above to routinely handle user input."

38 of 148 comments (clear)

  1. Derailed by lemur3 · · Score: 2, Funny

    I can see the blood now!

    1. Re:Derailed by Lars+T. · · Score: 2, Informative

      "Carpet bombing" neither executed arbitrary code nor has it not been fixed.

      --

      Lars T.

      To the guy who modded me down from perfect to terrible Karma - Apple haters still suck

    2. Re:Derailed by Lars+T. · · Score: 2, Insightful

      Was there not a recent demonstration on a 'blended threat' based on the safari bug that would execute code next time IE ran, also I beleive there is another similar method for firefox 2/3.

      No, there still is a bug in IE that will run any properly named DLL on the Desktop, whether it is downloaded with the "Carpet Bomb", or by hand with any browser, download tool (incl. FTP or P2P), or moved there, or put there by fairies. And there is also a bug in Firefox that allows somebody to "steal files", which has probably to do with a certain kind of file being in its Download Folder (by default the Desktop) - again, no matter how it got there. These are bugs that need to be fixed.
      --

      Lars T.

      To the guy who modded me down from perfect to terrible Karma - Apple haters still suck

  2. Re:The real story by JeremyGNJ · · Score: 3, Insightful

    That's really not the story. The story is how simple the exploits were and yet, how long it took to be discovered.

  3. Re:Confirmation by setagllib · · Score: 3, Insightful

    Then what is? Sun Java and Microsoft .NET have both had long histories of security patches. Python is a lot better but nothing is perfect.

    At least with a Linux Python/Ruby you get the security fix within hours as part of your regular operating system update. With Java you have to download the whole thing again from Sun's site. With .NET you have to wait for patch tuesday or apply a hotfix manually.

    --
    Sam ty sig.
  4. Re:The real story by mccalli · · Score: 4, Insightful

    The real story here is how quickly the bugs were patched. I'd like to see MS respond half as fast to holes in Windows and it's attendant parts and pieces.

    No. The real story here are the security bugs, precisely as described. This isn't cheerleading - to users of Ruby it really doesn't matter how fast some other imagined patch might have come out from another company for a different product. If I'm running Ruby, I need to know that these bugs exist and that patches can be applied for them.

    Drop the us vs them thinking - it doesn't help is pretty much just FUD.

    Cheers,
    Ian

  5. Re:The real story by Anonymous Coward · · Score: 5, Funny

    sooo... open source failed? that's what it sounds like you're saying. beware of pitchfork carrying moderators ;)

  6. Re:Confirmation by larry+bagina · · Score: 4, Interesting

    "Enterprise" means you don't blindly install updates on day 0.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  7. Re:message to staff at Apple HQ by LunarCrisis · · Score: 5, Insightful

    The bugs would have been there even if Apple hadn't found them. Why not thank them for improving the quality of Ruby?

    --
    Mr. Period: Nine is the one that's right by ten!
    Nine: One day I will kill him. Then, I will be Ten.
  8. Re:The real story by CrazedWalrus · · Score: 5, Insightful

    How did open source fail? Someone who wasn't the original author had access to the code and found the bugs. How quickly it's found is a function of how many qualified people are looking at the code. I didn't RTFA, but presumably Drew Yao, a member of the security team, was security auditing the code. This activity would have been much harder to impossible with closed source code.

    I'd say the system worked as advertised here.

  9. Goes to show ... by Qbertino · · Score: 2, Insightful

    This, IMHO, goes to show that Ruby isn't any better than the other Open Source interpreted languages. Despite what the Ruby fanboys allways claim, it is actually far less mature then, let's say, Python or PHP.
    A matured, tested and established mod_ruby, unicode and a few years more in the field is what Ruby needs before I take a look at it.

    My 2 cents.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:Goes to show ... by yogikoudou · · Score: 2

      I believe this is the PHP bug you mention: http://use.perl.org/~Aristotle/journal/33448 .

    2. Re:Goes to show ... by Etherized · · Score: 3, Insightful

      Keep in mind that ruby and PHP are essentially contemporaries - they've both been in real use for over a decade. By most measures, one would think of them as being "mature" technologies, and yet we still see bugs like this crop up in both languages. I think it just goes to show - while selecting a "mature" technology has its advantages, it will not make you immune to problems.

      For what it's worth, this appears to be a flaw in the official ruby interpreter. That's a big deal, of course, but just so you know: most people who speak the praises of ruby are talking about the structure of the language, not necessarily the implementation of the interpreter itself. There are alternate implementations of the ruby interpreter that are generally considered to be "better" than Matz's in many ways.

    3. Re:Goes to show ... by smallpaul · · Score: 3, Insightful

      So, um, how's jPHP and Jython coming along? Would you deploy a real life application on Jython?

      So, um, how's jPHP and Jython coming along? Would you deploy a real life application on Jython?

      Go team. Rah! Rah! Rah! YEAH!!!!

      But I have two questions:

      1. What does the relative merit of Jython versus Jruby have to do with the price of tea in China? Are you moving your apps from the buggy MRI to JRuby this week to avoid these security holes?

      2. What evidence do you have that Jruby is more appropriate for "real life applications" than Jython? I know people who have deployed real life applications on Jython since before the first checkin of JRuby. For example, Websphere ships with Jython.

      http://wiki.python.org/jython/JythonUsers

      Ruby has some real advantages over Python. But if you don't know them, don't just make stuff up.

    4. Re:Goes to show ... by bcrowell · · Score: 2, Informative

      Keep in mind that ruby and PHP are essentially contemporaries - they've both been in real use for over a decade. By most measures, one would think of them as being "mature" technologies, and yet we still see bugs like this crop up in both languages. I think it just goes to show - while selecting a "mature" technology has its advantages, it will not make you immune to problems.

      I'd interpret the same facts the other way around. A decade isn't very long for a programming language to mature. Ruby and PHP have both only been around for a decade, so they're not very mature. I do most of my coding in perl, but have done one significant project in ruby, and I can see some advantages and disadvantages of each. If you really like OOP, and/or you have a project that's naturally well suited to the OOP approach, then perl is an extremely awkward language, and ruby is much more natural. However, perl is 21 years old, and the perl 5 implementation is extremely mature. You simply don't run into the kind of implementation bugs in perl that you do in ruby. As a concrete example, my ruby project does a lot of string munging, and I had to choose between using ruby 1.9 in order to get a regex engine that was as full-featured as perl's, or using ruby 1.8. I chose 1.9, and after the project was complete and working well, I started running into cases where the interpreter's regex engine would crash the interpreter. You could say it's my own darn fault for choosing a beta version of the language, but with a more mature language I wouldn't have had to make a choice like that between features and stability. I've also had ruby code break because of changes in the design of the language, and that has never, ever happened to me with perl. (And before anyone starts up about how perl 6 will break everyone's code, no, it won't. Perl 6 will run perl 5 code in compatibility mode.)

    5. Re:Goes to show ... by SanityInAnarchy · · Score: 3, Insightful

      This, IMHO, goes to show that Ruby isn't any better at security than the other Open Source interpreted languages. Fixed that for you.

      And it never claimed to be. I don't know anyone who uses Ruby because it's more secure. Everyone I know who uses Ruby does so because of the beautiful syntax, pervasive OO, and other things that make it nicer to program in.

      far less mature then, let's say, Python or PHP. Oh, really?

      And again, it's not the security. I'm willing to risk having to patch my interpreter like this once in awhile, if it means I'm able to

      Keep in mind, this vulnerability is so far only a DoS, and won't necessarily affect most installations. Most people run multiple interpreters serving a single site, each load-balanced to. Knock out one and it'll be restarted, while the other continues to serve content.

      Which brings us to your next point...

      A matured, tested and established mod_ruby, unicode and a few years more in the field is what Ruby needs before I take a look at it. Well, let's see -- Unicode has existed, albeit not great, for quite awhile. 1.9 has had Unicode strings from the beginning.

      mod_ruby -- you do realize pretty much no one in the Ruby world uses Apache, right? It's all mongrels and nginx... But if you must, there's Passenger.

      a few years more in the field is what Ruby needs before I take a look at it. Obviously, you really haven't taken a look at it.
      --
      Don't thank God, thank a doctor!
  10. Re:The real story by headLITE · · Score: 4, Insightful

    A vulnerability in an open source project was found by a third party doing a security audit of the code. The possibility to validate the source code is exactly what open source proponents claim is the reason for open source being more secure. Everybody can have a go, a thousand pairs of eyes see more than one pair, and all that. Try auditing Visual Basic 6 for comparison.

  11. good news by corbettw · · Score: 4, Funny

    Now it's time to start calling up all those RoR sites and use this to convince them to switch the Django.

    --
    God invented whiskey so the Irish would not rule the world.
  12. Re:Confirmation by headLITE · · Score: 2, Insightful

    Agreed. It also usually doesn't refer to a programming language or environment. At any rate, "enterprise" applications have historically been written in a bunch of languages that don't do array bounds checking. Granted, ruby is supposed to do it, but I mean, seriously - are kids these days so spoiled by JavaScript and VB that this kind of error is a surprise and the biggest bug ever?

  13. Re:Confirmation by /ASCII · · Score: 5, Funny

    No, "Enterprise ready" means they didn't have to deal with that shit on Star Trek.

    --
    Try out fish, the friendly interactive shell.
  14. Re:The real story by Richard_at_work · · Score: 2, Insightful

    This activity would have been much harder to impossible with closed source code.

    I'd say the system worked as advertised here.

    Yup, because Microsoft certainly never have exploits such as these discovered...
  15. Re:The real story by moosesocks · · Score: 3, Interesting

    Try auditing Visual Basic 6 for comparison. I don't need to see the source to know that VB6 is completely insecure. The documentation is more than sufficient to prove that the entire language was fundamentally flawed.
    --
    -- If you try to fail and succeed, which have you done? - Uli's moose
  16. Re:The real story by Anonymous Coward · · Score: 5, Insightful

    How did open source fail? Someone who wasn't the original author had access to the code and found the bugs. How quickly it's found is a function of how many qualified people are looking at the code. I'd say the system worked as advertised here.
    Slight correction -- it's a function of how many qualified and honest people are looking at the code. Now, the skilled but dishonest Russian hacking cartels had a financial incentive to look through the code for security problems; comparatively few security researchers had financial incentives to do so. Are you really sure this is the first time this bug has been discovered? Or just the first time by nice cooperative people who don't exploit it and keep it secret?
  17. Someone had to say... by Hognoxious · · Score: 4, Funny

    Ruby - it's the new PHP.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  18. Re:Confirmation by Anonymous Coward · · Score: 2, Insightful

    Actually, considering its age, Java DOESN'T have a "long" history of security patches. Java was designed by security freaks and the security both of the core language and the standard platforms is extensively vetted and tested by security professionals. Which is why you have to look long and hard for news reports of major security breaches in Java.

    The Java system is considered to be an integrated whole and new releases have to pass an extensive suite of tests before they are certified. Yes, it's a royal pain in the [censored] to have to download an entire enormous new release of the runtime engine and support classes, but the upside is that you don't get the kinds of security and reliability issues that come from a mix-match-and-patch approach. There's only a small number of possible configurations to keep clean.

  19. Funny how open source always wins... by Anonymous Coward · · Score: 5, Insightful

    Case 1: the code has no bugs: "many eyes make for shallow bugs!" everyone chants.

    Case 2: the code has bugs which get reported and fixed. "See, this would have taken much longer if the source was closed!" This claim is impossible to verify objectively but is stated as a fact, regardless of how trivial the bugs are.

    1. Re:Funny how open source always wins... by Anonymous Coward · · Score: 2, Insightful

      And then there are those of us who just don't give a damn about what other people think, but continue to use open source on both our servers and our desktops not because of what other people claim, but because in our experience it works better.

    2. Re:Funny how open source always wins... by Anonymous Coward · · Score: 2, Insightful

      Case 1 is a myth. All software has bugs. Even the best and most thoroughly reviewed code typically at least 1 bug per thousand lines of code. Always. (However, they're not always security related like this.)

  20. Re:message to staff at Apple HQ by UnknowingFool · · Score: 4, Insightful

    Apple finds serious bugs in Ruby. They tell the Ruby developers. Ruby developers issue patches. That's not sensational.

    MS finds a bug in Safari. They tell everyone not to use Safari. I see slight differences. :P

    --
    Well, there's spam egg sausage and spam, that's not got much spam in it.
  21. Re:The real story by CrazedWalrus · · Score: 3, Insightful

    I didn't say anything about Microsoft. Obviously there are, but the source is much more difficult to obtain. If the source can't be obtained, auditors must use more difficult types of testing, or just hope that the vendor did their job correctly.

    My only point was that Apple would have a much more difficult time auditing, say, Office for Mac, than they would with Ruby due to the requirement for source code agreements or using more arcane methods like blackbox testing or disassembly. The same applies to Photoshop, Flash, or any other 3rd party closed-source app.

    The victory here is that Ruby was improved by a 3rd party who had ready access to the source. When the source is available, this will happen much more often than when it's not.

  22. FUD? by MarkusQ · · Score: 2, Insightful

    These vulnerabilities are likely to crop up in just about any average ruby web application. And by 'crop up' I mean 'crop up exploitable from trivial user-specified parameters.'

    Huh? Who lets users enter arbitrary integers to index into arrays? Or let's users submit arbitrary loops for execution? Apart from the statement quoted above, what indication is there that any of these would "crop up" in any but the most contrived circumstances?

    --MarkusQ

  23. Re:Confirmation by Idaho · · Score: 3, Insightful

    Granted, ruby is supposed to do it, but I mean, seriously - are kids these days so spoiled by JavaScript and VB that this kind of error is a surprise and the biggest bug ever?

    1. If the interpreter is supposed to do it, except it then turns out it actually doesn't (or doesn't do it correctly), then yes.
    2. If the problem occurs in something that is a part of the language itself, or at least part of its standard library/built-in types, or, however you want to define it, if it is in the set of stuff that everyone who has the language installed has installed, and the functionality is used in pretty much any program ever written in the language, then yes.

    So, yes.

    --
    Every expression is true, for a given value of 'true'
  24. I have patched all of my customer's servers by MarkWatson · · Score: 2, Insightful

    I did some testing on an off line server, and then pushed these patches.

    I am concerned about "Ruby the Platform". I have dealt with deployment and scaling issues for a few years on a customer project written in Rails + Common Lisp, and as much as I *love* coding in Ruby and Lisp, this experience has also made me appreciate "Java the platform" :-)

  25. Re:The real story by drinkypoo · · Score: 2, Interesting

    Yup, because Microsoft certainly never have exploits such as these discovered...

    The difference is who finds them and what happens when they are found. Vulnerabilities in Microsoft products are found either by accident (I pass you some data which should be valid and you choke, or I pass you some data which should be invalid and you don't choke, or you just crash instead of detecting the invalid data and throwing an exception or local equivalent, which is what you SHOULD do EVERY TIME) or by malicious motherfuckers deliberately looking for the above conditions, or disassembling the code and looking for potential race conditions.

    By contrast, bugs in open source products are found by looking at the source code and by the above means. But the difference is that the number of non-malicious individuals looking at the code is far larger. So basically, all the same things happen in both places, but the first person to find the bug is more likely to be altruistic in the open source world; and furthermore, the bug is more likely to be found by an altruist at all (ever) in the open source world. You can be sure that a number of Microsoft bugs have been fixed silently without anyone ever announcing them... Which means only the malicious types know they exist, and people who don't patch unless they feel they have to are exposing vulnerabilites that they have no real way to find out about because they lack the requisite time and/or skills to test for such problems.

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  26. Not just RoR by Slashdot+Parent · · Score: 2, Interesting

    This reminds me of the notorious suidperl vulnerability from back in the day. In a nutshell, you could use the following code to achieve a root shell from an unprivileged account (apologies if I don't get it exactly right... I don't have an ancient system to verify on):

    #!/usr/bin/suidperl -w
     
    $< = 0;
    $> = 0;
     
    `/bin/bash`;
    That was available for how many years? Anyhow, that's much more serious than this Ruby DoS attack. ;)
    --
    They don't grade fathers, but if your daughter's a stripper, you fucked up. --Chris Rock
  27. DoS for ruby? You don't need exploits for that by Anonmyous+Coward · · Score: 2, Funny

    I LOVE ruby as a language, but let's be realistic here. All you need for a DOS attack against a ruby-based web application of any complexity is a few dozen users using it as intended. No need to waste time figuring out complicated exploits for that.

  28. Re:Confirmation by FooBarWidget · · Score: 2, Funny
  29. Re:message to staff at Apple HQ by Lars+T. · · Score: 2, Insightful

    What a joke.

    Look at almost every security advisory issued out there. "Remedy: Do not/restrict usage of X until bug is resolved".

    Making this a stab at MSFT just shows you up as an Apple fanboy.

    Ignoring that there is a much bigger hole in IE that the Apple bug makes a tiny bit easier to trigger shows you up as what then?
    --

    Lars T.

    To the guy who modded me down from perfect to terrible Karma - Apple haters still suck