Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Security Operating Systems BSD

Cambridge Researcher Breaks OpenBSD Systrace 194

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."
This discussion has been archived. No new comments can be posted.

Cambridge Researcher Breaks OpenBSD Systrace

Comments Filter:
  • by Gopal.V ( 532678 ) on Thursday August 09, 2007 @09:27AM (#20169547) Homepage Journal

    James Morris has put up an analysis [livejournal.com] 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.

    • by afidel ( 530433 ) on Thursday August 09, 2007 @09:43AM (#20169739)
      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.
      • by gwern ( 1017754 )
        If the message-passing microkernels are any guide, thunking on every kernel call could be very expensive unless you go to great lengths (like L4) to avoid it.
      • Re: (Score:3, Informative)

        by Jokkey ( 555838 )

        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.

    • Re: (Score:3, Informative)

      by makomk ( 752139 )
      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.
  • Linux?` (Score:3, Insightful)

    by morgan_greywolf ( 835522 ) on Thursday August 09, 2007 @09:28AM (#20169557) Homepage Journal
    Any word if any of these vulnerabilities affect Linux or other Unixes as well?
    • Re:Linux? (Score:3, Informative)

      by Noryungi ( 70322 )
      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.
      • Re:Linux? (Score:5, Informative)

        by x_MeRLiN_x ( 935994 ) on Thursday August 09, 2007 @10:28AM (#20170321)
        Would you be talking about this [watson.org]?
      • Re:Linux? (Score:4, Interesting)

        by Hawke ( 1719 ) <kilpatds@oppositelock.org> on Thursday August 09, 2007 @12:36PM (#20172183) Homepage Journal
        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.)
  • are other UNIX-based Operating Systems vulnerable as well? Systrace and especially Sudo are very common in nearly all UNIX-like Systems, so maybe Linux and MacOS X users should also be concerned? And what about Windows, since commercially availabe anti-virus systems are also afflicted? That seems like a very serious vulnerability to me...
    • 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!
      • by eno2001 ( 527078 ) on Thursday August 09, 2007 @10:03AM (#20169997) Homepage Journal
        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).
    • by makomk ( 752139 )
      Only an experimental feature in a prerelease version of sudo is affected by this vulnerability; normal users of sudo have nothing to worry about.
    • Re: (Score:3, Informative)

      by ratboy666 ( 104074 )
      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. Alternati
    • by Znork ( 31774 )
      Most security applications implemented as system call wrappers would be vulnerable (basically anything where there's an opportunity to modify the checked system call post-check by tricking todays modern and eminently interruptable kernels into doing something else than getting on with executing the syscall for a few cycles), altho I suspect that anyone running sudo as primary security enforcement and logging application isnt exactly worried about this level of fairly arcane exploits (note that more lowlevel
  • by Antarius ( 542615 ) on Thursday August 09, 2007 @09:43AM (#20169731)
    The tremors that you are feeling are from the sounds of the collective users of OpenBSD all simultaneously shouting "Fuck!" in exasperation.
    • by nateb ( 59324 ) on Thursday August 09, 2007 @09:47AM (#20169791)
      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.

      • by Dan Ost ( 415913 )
        OpenBSD is my favorite platform for purpose-built machines. I do appreciate the security, but the main reason I like it is for the quality documentation (especially the man pages!) and the ease of setup.

        The majority of my machines run Gentoo, but Gentoo can't really by used as a fire-and-forget platform like OBSD can be.
      • by peacefinder ( 469349 ) <alan DOT dewitt AT gmail DOT com> on Thursday August 09, 2007 @10:33AM (#20170401) Journal
        All twelve of them. :)

        We yell really loud.

        (And I actually yelled "Wow!". We're not a homogenous lot.)
      • That's 13 now, I just picked up the disks a little while ago.

        OpenBSD will never have the popularity or wide range of ports that FreeBSD has but it's a pretty solid system designed with a clear mandate. It's worth installing, even just to see the security decisions that have been taken so you can apply them to another Unix-like system. Like Dan Ost said, the documentation is excellent and the developers and mailing list users have been pretty helpful. The only thing I'm missing is WPA support.
    • Re: (Score:1, Redundant)

      by guruevi ( 827432 )
      I didn't know they could BOTH shout thatloud.
  • by rubycodez ( 864176 ) on Thursday August 09, 2007 @09:52AM (#20169859)
    on local user/software exploits? my domains have over a thousand users, but no one logs into an account on the machine.
    • by xaxa ( 988988 )
      I have SSH access to some machines I have webspace on (with Fasthosts, I think). I think they use GNU/Linux, but presumably there are people offering the same service but with BSD.
    • by Alioth ( 221270 ) <no@spam> on Thursday August 09, 2007 @10:14AM (#20170107) Journal
      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.
      • bullshit, crap code by incompetent programmers causes input data to be executed, the scripting languages all have ways to flag data as tainted suspect and deal with it properly with no possibility of execution (e.g. sql injection attacks, etc.) Piss poor development practices will always lead to security breaches, and that goes for any language not just the scripting ones. The biggest and most damaging attacks have been due to sloppiness in the c/c++ realm (ooo, who would ever give us more data than we ex
    • Oh, that's easy. Because when an attacker breaks into someone's CMS (because your users most certainly do not read about security updates on software mailing lists, and there's no way in hell you even know what they're running), suddenly that attacker *does* have a login on that machine. They can now run software as the "httpd" user. This is the reason jail(8) was invented. And what do you know... they found a vulnerability in a certain version of jail.
  • by pathological liar ( 659969 ) on Thursday August 09, 2007 @09:53AM (#20169865)
    ... 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.
    • Parish that thought.

      Because of their egos, a fix is likely being commited to CVS as we speak.
      • Re: (Score:3, Funny)

        Parish that thought.

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

  • by millert ( 10803 ) on Thursday August 09, 2007 @09:54AM (#20169887) Homepage
    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
    • Hello Todd.

      Thanks for sudo, and thanks for this clarification.
    • by psmears ( 629712 )

      Given the deficiencies of systrace (and ptrace) it is unlikely that this feature will be present in any future sudo release.

      That's a shame...

      Granted, as the paper shows, it's of no use as a feature for preventing your box from getting pwned. But the it can still be useful: often I'm more worried about the system being brought down by local users with root access, than by external forces. These users can be trusted not to break things deliberately, or overwrite the logs, but not necessarily to remember everything they've recently done when something goes wrong. ("Oh, yeah, I deleted /etc/passwd. Didn't think it was important,

      • by epine ( 68316 )
        Yes, as per usual, the tribalism reflex on this thread has shut down useful brain circuits in most of the posters. Gorged with tribalistic lust, the average post here seems to be able to consider only the issue of getting pwned, or the paranoid dichotomy between useful and secure, or the purportedly paltry size of the OpenBSD user base, or the irritating slogan at the top of the OpenBSD home page (which hardly negates their contributions to the security ecology since the inception of the project no matter
  • It appears he's removed the code from the presentation (though it still says it's present, I don't see it). Good.
  • Ha Ha (Score:5, Funny)

    by UnknowingFool ( 672806 ) on Thursday August 09, 2007 @09:58AM (#20169931)
    Sweet justice! My Win98 boxes have finally protected me against a hole. I am invinci*^&#%
    $#%#^&&!#$@$

    [CONNNECTION LOST]
  • by Mattintosh ( 758112 ) on Thursday August 09, 2007 @09:59AM (#20169941)
    Theo DeRaadt goes on a rampage in 5... 4... 3... 2...
    • Re: (Score:1, Interesting)

      by Anonymous Coward
      De Raadt doesn't do Rampages, he only does games available via console, like Tetris, Hunt and Hangman.

      He also doesn't get upset about problems being found in software, like any sane person, he's more afraid of the problems he's not finding out about.
    • Correct me if I'm wrong, but Robert Watson is a kind of security guru for FreeBSD, isn't he ? From his page :

      Robert Watson (FreeBSD Home Page) : I'm a FreeBSD Core Team member, as well as member of the security officer and release engineering teams.
      I hope nobody will take it as a plot of FreeBSD to gain/keep lead over other BSDs.
      • by mulvane ( 692631 )
        The BSD's work pretty closely together and if he did find something in another BSD, it could be very possible he was looking into a feature to port over and doing his own testing of the code before hand found this. Is this what happened? I am not sure, but it is possible. The BSD's are really in a non-compete status with each other and are more in a sharing of knowledge of the forks of the original base.
      • Robert Watson is apparently [devnull.cz] the fellow who suggested porting systrace to FreeBSD. Seems like he's been working on this for a long time.

        "I hope nobody will take it as a plot of FreeBSD to gain/keep lead over other BSDs."

        I shouldn't think so. At least for sysjail, this problem affects "All versions [...] on all architectures." It doesn't seem to be an OpenBSD-specific problem, but with many implementations of systrace(4). If FreeBSD has already fixed their systrace, then presumably the other BSDs will be look
  • by diegocgteleline.es ( 653730 ) on Thursday August 09, 2007 @10:05AM (#20170025)
    ...and he's also one of the most important FreeBSD hackers.
  • Site is slashdotted, anyone got a copy of the article?
    • Re: (Score:1, Interesting)

      by Anonymous Coward
      By the way, what has happened to the slashdot effect? Not so long ago the first thing I did when reading about something on slashdot was finding a coral or google cache link to the actual article on the comments section. Nowadays - and I haven't really even thought about it - the articles usually just work. Are the webservers better now, or has the power of slashdot effect declined?

      Or have I just been lucky?
      • Re: (Score:1, Funny)

        by Anonymous Coward

        Are the webservers better now, or has the power of slashdot effect declined? Or have I just been lucky?

        Yes.

      • Re: (Score:3, Funny)

        by jjrockman ( 802957 )
        Nah, it's just that nobody RTFA anymore.
      • by cp.tar ( 871488 )

        By the way, what has happened to the slashdot effect? Not so long ago the first thing I did when reading about something on slashdot was finding a coral or google cache link to the actual article on the comments section. Nowadays - and I haven't really even thought about it - the articles usually just work. Are the webservers better now, or has the power of slashdot effect declined?

        Or have I just been lucky?

        It is now known as the Slashdot Quantum Paradox.

        Previously, the Slashdot Paradox meant that although nobody ever read TFA, the servers were still swarmed and brought down to their knees by the sheer force of discussion.

        Nowadays, due to several breakthroughs in quantum science and technology, the Slashdot Quantum Paradox ensures that as long as nobody actually goes to RTFA, the servers stay online. However, should anybody actually go and try to RTFA, the Slashdot Effect would affect it in full.

        Since you

  • by Anonymous Coward
    This class of problem potentially affects a variety of software. Systrace (which runs on Linux, NetBSD, OpenBSD, Darwin, etc) was given as one example of software that is affected. Even Sun's Dtrace might be vulnerable.
  • by amper ( 33785 ) * on Thursday August 09, 2007 @10:47AM (#20170611) Journal
    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!
  • by cgdae ( 996476 ) on Thursday August 09, 2007 @12:16PM (#20171903) Homepage

    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 [openbsd.org]

  • hey could someone do me a favor and tell me if m0n0wall or Pfsense ... are vulnerable to this?
  • by widman ( 1107617 )
    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.

  • by raddan ( 519638 ) on Thursday August 09, 2007 @03:38PM (#20174571)
    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 [nycbsdcon.org] 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.
  • ...that's essentially what the presenter is saying. The 'chroot' style jail is essentially a fake system root designed for development purposes, so you can have a little fake clean-room environment in which to build. Later, this concept was adapted for security purposes -- hence systrace, sysjail... What he's suggesting is that this userland approach is easily circumvented, and the best approach would be to use a mandatory access control approach at the kernel level, ala SELinux. To me, it's not so much tha
  • Undeadly coverage (Score:4, Informative)

    by zyche ( 784345 ) on Thursday August 09, 2007 @04:08PM (#20174941)

    Coverage on Undeadly [undeadly.org].

    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.

  • http://www.systrace.org/index.php?/archives/14-Eva ding-System-Sandbox-Containment.html [systrace.org]

    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 impos

A complex system that works is invariably found to have evolved from a simple system that works.

Working...