Slashdot Mirror


Cambridge Researcher Breaks OpenBSD Systrace

An anonymous reader writes "University of Cambridge researcher Robert Watson has published a paper at the First USENIX Workshop On Offensive Technology in which he describes serious vulnerabilities in OpenBSD's Systrace, Sudo, Sysjail, the TIS GSWTK framework, and CerbNG. The technique is also effective against many commercially available anti-virus systems. His slides include sample exploit code that bypasses access control, virtualization, and intrusion detection in under 20 lines of C code consisting solely of memcpy() and fork(). Sysjail has now withdrawn their software, recommending against any use, and NetBSD has disabled Systrace by default in their upcoming release."

43 of 194 comments (clear)

  1. SELinux and the same ... by Gopal.V · · Score: 5, Informative

    James Morris has put up an analysis of the same vulnerabilities.

    And pushing the system code down into lower echelons of execution (i.e kernel), the way SELinux does it, is a valid fix.

    1. Re:SELinux and the same ... by afidel · · Score: 5, Insightful

      I wonder what the performance penalty would be for thunking to kernel space would on every such operation would be? If it was well implemented I would guess it would be minimal since you could just pass the call off to the called kernel object directly. I also wonder what if any security vulnerabilities would be exposed by moving that extra code in kernel space. I know for the TrustedBSD tools it would be minimal due to their strict code checking policies, but for other systems having this much extra code in kernel space might be a risk.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    2. Re:SELinux and the same ... by makomk · · Score: 2, Informative

      Just putting the validation code in the kernel is not, by itself, sufficient - it's important that any arguments are copied from userspace exactly once. If the validation code and the actual syscall code each do their own copy from userspace, this is a potentially exploitable security issue.

    3. Re:SELinux and the same ... by Jokkey · · Score: 2, Informative

      I wonder what the performance penalty would be for thunking to kernel space would on every such operation would be?

      What's being discussed here is system call wrapping, and system calls by definition go to kernel space anyway. No extra thunk to kernel space is required.

  2. Linux?` by morgan_greywolf · · Score: 3, Insightful

    Any word if any of these vulnerabilities affect Linux or other Unixes as well?

  3. I'm not worried by Gazzonyx · · Score: 2, Funny

    I'm not worried about a vuln. in sudo; I always log in as root and don't have sudo running :). Remember, Real Programmers log in as root. Take that h4x0rz!

    --

    If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.

    1. Re:I'm not worried by eno2001 · · Score: 5, Funny

      You know the old saying... "you get what you stay for". As long as you're logging in as root you will damage your system. It's a known fact. Anyone who logs in as root eventually dostoyevsky's their system. Logging in as root is dangerous. Even using 'su -' is dangerous. 'sudo' provides some level of security and accountability but even that is dangerous. I can't tell you how many times I've seen people type 'sudo bash' and then tool around doing everything as root all the time. The only way to really be safe is to never use any super user abilities whatsoever. The way I've handled it is that any time I run into something that I need root access for, I just give up. So I don't have any new users other than the ones I originally set up when I installed Ubuntu. I also don't have any access to the CD-RW drive built into the system, but that's OK since I'm not an illegal music and software pirate (only pirates use CD-R/CD-RW). I can't use the attached scanner that once worked in Windows 98 but that's OK since there is no need to scan photos or anything in Linux since there are no apps with which to work on them anyway. Whenever the system pops up asking me for the root password I just cancel out and stick with whatever settings the system had. Basically for me, a request for the root password is a threat to the security of my PC, myself and possible the nation or even global security. So in short DO NOT EVER USE root access of ANY kind. It's very dangerous and best left to the experts (bearded and bald scientists in dusty university halls).

      --
      -"...bad old ideas look confusingly fresh when they are packaged as technology" - Jaron Lanier (Digital Maoism on Edge.o
    2. Re:I'm not worried by bl8n8r · · Score: 3, Funny

      Thank God! A user that finally gets security! Look at those pigs wizzin by...

      --
      boycott slashdot February 10th - 17th check out: altSlashdot.org
  4. No need for alarm! by Antarius · · Score: 5, Funny

    The tremors that you are feeling are from the sounds of the collective users of OpenBSD all simultaneously shouting "Fuck!" in exasperation.

    1. Re:No need for alarm! by nateb · · Score: 5, Funny
      The tremors that you are feeling are from the sounds of the collective users of OpenBSD all simultaneously shouting "Fuck!" in exasperation.

      All twelve of them. :)

      I like the thought of openbsd, though, having never used it. I'm sure everything will be fine.

      --
      -- Nate
    2. Re:No need for alarm! by peacefinder · · Score: 5, Funny

      All twelve of them. :)

      We yell really loud.

      (And I actually yelled "Wow!". We're not a homogenous lot.)

      --
      With reasonable men I will reason; with humane men I will plead; but to tyrants I will give no quarter. -- William Lloyd
  5. Re:so much for... by MrNaz · · Score: 5, Funny

    Why didn't you just say "I'm scared." ?

    --
    I hate printers.
  6. Re:so much for... by ArwynH · · Score: 4, Informative

    And it still only has had two remote holes in the default install in more than 10 years. This isn't a remotely exploitable hole, it allows privilege escalation, which requires access to the system and thus is a local hole. It's still a whopper of a hole though...

  7. why give much of a crap by rubycodez · · Score: 2, Informative

    on local user/software exploits? my domains have over a thousand users, but no one logs into an account on the machine.

    1. Re:why give much of a crap by Alioth · · Score: 4, Insightful

      Local exploits are only a phpBB vulnerability from being a remote exploit. If you're running a hosting service, and you're not treating local vulnerabilities as seriously as remote ones, it's only a matter of time before your machine is pwned and becomes a spam zombie. I've seen it happen.

      If you allow scripting on your server, then you've essentially given your users shell access, anyway.

  8. OpenBSD Security by pathological+liar · · Score: 4, Funny

    ... now if only this would lead to a little ego deflation and humility among OpenBSD developers.

    As long as I'm dreaming, I also want a pony.

    1. Re:OpenBSD Security by frenchbedroom · · Score: 3, Funny

      Parish that thought.

      You mean like, put it in a convent or something ? Oh no, I get it, you mean he should build a little chapel in memory of it, right ?

  9. No released version of sudo affected by millert · · Score: 5, Informative

    The sudo systrace support is part of an experimental feature ("monitor mode") not present in any of the real sudo releases (though the code is available via anonymous cvs). Given the deficiencies of systrace (and ptrace) it is unlikely that this feature will be present in any future sudo release.

      - todd

  10. Ha Ha by UnknowingFool · · Score: 4, Funny

    Sweet justice! My Win98 boxes have finally protected me against a hole. I am invinci*^&#%
    $#%#^&&!#$@$

    [CONNNECTION LOST]

    --
    Well, there's spam egg sausage and spam, that's not got much spam in it.
  11. Brace for impact... by Mattintosh · · Score: 5, Funny

    Theo DeRaadt goes on a rampage in 5... 4... 3... 2...

  12. "cambrige researcher"... by diegocgteleline.es · · Score: 3, Informative

    ...and he's also one of the most important FreeBSD hackers.

  13. Re:fix shedules ? by orclevegam · · Score: 3, Informative

    as usual I would assume *bsd to put out fixes quite timely...

    Well, the fix for now appears to be don't use the vulnerable software, but considering that the vulnerability allows you to break the software such that it behaves as if it wasn't running, I have to wonder if people should use it anyway and just accept that for now anyone that knows how can bypass that particular security check. Also, if it was something simple like a buffer overrun that would be trivial to patch, but because of the way this particular vulnerability functions (concurrency attack) there's not simple solution. Some have suggested pushing the code to kernel space, but as they've also pointed out, that's rather risky in its own regard. Short of some kind of provision in the kernel to prevent the attacks I'm not sure how this could be fixed (although I haven't seen to many details, just that it involves re-writing some args after they've already been scanned by systrace).

    --
    Curiosity was framed, Ignorance killed the cat.
  14. Re:Linux? by Noryungi · · Score: 2, Informative

    Yes, M. Watson also attacked equivalent programs (GSWTK) under Linux successfully.

    Read his blog post, as some of the techniques described are quite interesting. Too bad we can't read the full paper.

    --
    The right to offend is far more important than the right not to be offended. (Rowan Atkinson)
  15. Re:Why??? by orclevegam · · Score: 4, Interesting

    Why is everyone so hell bent on BREAKING things? Can't we all just try to get along for an instant?

    Because the fastest way to learn about something is to break it. Why do you think physicists spend all that time and money on particle accelerators?

    --
    Curiosity was framed, Ignorance killed the cat.
  16. Re:no by Anonymous Coward · · Score: 2, Insightful

    What if you can get a user shell by using an exploit in (firefox|x-chat|bind|apache|ftp|ssh|sendmail|ntp|w hatever open port)?
    Guess you get what you deserve when you put a machine on the internet.

    Sure it is only an unprivileged local user, what could you do with that.

    Oh, wait. You could get root if you had a local user using an other exploit.

  17. Re:no by Steve+Baker · · Score: 5, Funny

    Exactly, why would anyone want to put a computer on the internet? That's just stupid!

  18. Re:Linux? by x_MeRLiN_x · · Score: 4, Informative

    Would you be talking about this?

  19. Re:so much for... by teknopurge · · Score: 3, Insightful

    Then choose a better FTP server - it's not OpenBSD's fault you installed pr00tme-ftpd.

    I can also publish a root password for my servers on digg. Does that mean it's OpenBSD's fault for that 'exploit' as well?

    The purpose of the default install is a configuration that has been audtied by _the_ most anal development team on the planet. This is nothing but a good thing, and if people have a problem with Theo's attitude, feel free to fork the codebase.

    On my list of the 10 best OSS projects, OpenBSD is in the top 5.

  20. This is exactly why I love OpenBSD! by amper · · Score: 4, Insightful

    The very fact that the OpenBSD project makes itself such a huge target for would-be hackers is what makes it almost certain that any vulnerabilities will be found and patched. No handwringing is necessary here, though quite a lot of recoding may be involved. We can all look forward to an even more secure OpenBSD very soon. Keep up the good work, everyone!

  21. Re:fix shedules ? by TubeSteak · · Score: 3, Informative

    as usual I would assume *bsd to put out fixes quite timely... FTFA: All affected vendors received at least six months, and in some cases many years advance notice regarding these vulnerabilities.
    --
    [Fuck Beta]
    o0t!
  22. Re:Article? by jjrockman · · Score: 3, Funny

    Nah, it's just that nobody RTFA anymore.

    --
    Quit jabbering on the phone while driving. You are not that important.
  23. Re:Since NetBSD seems to be affected as well... by ratboy666 · · Score: 2, Informative

    Given that the vulerability exploited is a system call race, it may be that the "unwrapped" system calls may be exploited as well.

    Basically, wrapping the call (supposed to increase security) make the race more exploitable. It is NOT "sudo" that is at fault, specifically, because sudo (in its current release) does not do call wrapping.

    There is an easy solution available -- simply disallow all execution between the time the system call is invoked, and all parameters have been copied to system space. Alternatively, do not allow threading, and mapping of memory used for parameters in an active call (a bit more difficult).

    A security audited system call interface is needed, along with a prohibition on wrapping system calls expected by an application (because those wraps could be exploited by an attacking program).

    And you are right -- Windows is probably more vulnerable to this, simply because there are more system calls that use buffer pointers.

    But this entire class of exploit is "local only", which means that the system needs to be comprimised another way first; this can be used to obtain root, or use unauthorized resources.

    SELinux can be used to prevent much of the damage possible, as can Trusted Solaris. I don't know if there is a Windows eqivalent.

    --
    Just another "Cubible(sic) Joe" 2 17 3061
  24. Re:no by shadowmas · · Score: 2

    these are exploits for a local user on system, anyone who puts a machine on the internet and lets people log into actual Unix accounts deserves what they get. Unless of course they did it because they live in the real world and actually practical requirement needing that to be done.

    While we're disabling any form of shell access for any reason whatsoever, why not stop all those HTTP servers as well and the SMTP, DNS and all that crap as well. After all anybody who dares expose such a system on the internet when history tells us that there will be new vulnerabilities found in those software is obliviously an idiot.
  25. Re:so much for... by EvanED · · Score: 5, Funny

    On my list of the 10 best OSS projects, OpenBSD is in the top 5.

    In other words... it's in your list of the 5 best OSS projects.

    (sorry)

  26. Re:so much for... by DrSkwid · · Score: 2

    OpenBSD auditing isn't the god of all auditing you think it is.

    This is just another piece of audited code that roots you.

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  27. OpenBSD's man page for systrace mentions this? by cgdae · · Score: 5, Informative

    OpenBSD's systrace manpage appears to mention this problem in the BUGS section:

    Applications that use clone()-like system calls to share the complete address space between processes may be able to replace system call arguments after they have been evaluated by systrace and escape policy enforcement.

    Or see http://www.openbsd.org/cgi-bin/man.cgi?query=systr ace&apropos=0&sektion=0&manpath=OpenBSD+Current&ar ch=i386&format=html

    --
    http://op59.net/
  28. Re:Linux? by Hawke · · Score: 3, Interesting

    The presentation covers it pretty well. At least the GSWTK attack.

    (It's a straight forward time-of-use vs. time-of-check attack. And we were at least partially aware of it when we wrote GSWTK. The problem is that the original system calls require memory in the processes space, so you can't just copy in the string after you validate it to keep the process from changing it. I wrote some methods for Linux that allocated extra pages in the processes memory space so we could copy in the string, but that just makes the attack harder via obscurity. It doesn't address the fundamental issue at all.)

  29. Re:so much for... by teknopurge · · Score: 2, Insightful

    well-played old chap.......... ;)

  30. OpenBSD record: Good by widman · · Score: 2, Insightful
    The only meaningful bug they had lately was the IPV6 mbuf. And even that one obviously affected only people using IPv6.

    This race bug was known for ages. It's even hinted in the man page. Stop the FUD.

  31. Sysjail is really just one guy by raddan · · Score: 2, Informative

    Kristaps Dzonsons. And I'm not sure if he ever really intended for it to be for production use. I saw his talk at NYCBSDCon last year, and my impression was "here's a neat tool I'm working on guys, I'm still working out a lot of things, come play if you want". Not that this isn't an important vulnerability to address-- but I'd be surprised if anyone was currently using sysjail in an important production role.

  32. Undeadly coverage by zyche · · Score: 4, Informative

    Coverage on Undeadly.

    To answer some anti-OpenBSD bias from the summary above: systrace is really Niels Provos toy, OpenBSD just includes it in the base install just as NetBSD does; regarding sudo, it has been addressed in a comment above (not vulnerable in the actual released version); and by saying that NetBSD has disabled systrace that implies that OpenBSD has it still enabled. Except that it is a tool that isn't used by the default install at all - you have to enable and configure it yourself. And as the Undeadly post states: Since 2002, the systrace(1) man page included a warning in the BUGS section about the possibility of escaping the policy enforcement because of the behavior of certain system calls..

    Personally I have never liked the idea of systrace - leaves way to much to to me as a system administrator to fuck up.

  33. Re:so much for... by jimicus · · Score: 2, Insightful

    Let's be reasonable about this for a moment.

    Once someone has the power to execute arbitary code on your system, then it is arguably only a matter of time before they can do what they please on it. Which is precisely why you don't use the same OpenBSD box for your firewall as you do for giving users a shell account on a Unix box.

  34. Systrace.org post on this alleged bug by widman · · Score: 2, Informative
    http://www.systrace.org/index.php?/archives/14-Eva ding-System-Sandbox-Containment.html

    At WOOT this year, Robert Watson presented a paper on how to evade popular system call interposition systems, including Systrace. For Systrace, Robert noticed that the arguments written to the stackgap could be replaced by a co-operating process after Systrace performed its policy check. The initial prototype of Systrace as described in the paper avoided this problem by using a look-aside buffer in the kernel. This imposes a slight performance penality but I hope that this obvious solution is going to be included in the OpenBSD and NetBSD kernel soon.
    Also check the comment by the "Cambridge Researcher", kind of acknowledging it's nothing new.