News for hackers. Stuff that matters.
Re:Return-Oriented Programming without Returns (on the x86) by tptacek on Saturday February 27, 2010 @05:40PM (#1155964)
Ok, so security papers on Hacker News never get that much love, but take my word for it that you want to read this one.

This paper is the moral equivalent of that post from yesterday about how you could derive all of ASCII from []()+! in Javascript. Here, the authors are trying to evade runtime defenses that prevent memory corruption exploits from uploading executable code in target processes. To control execution, they analyze target binaries and synthesize a turing complete runtime out of scraps of legitimate basic blocks.

From 34 instruction sequences, they essentially derive a VM with load/store/move, add/sub/neg/and/or/xor, conditional branches, and call (read the first couple pages and skip ahead to page 12 for the diagram of what "call" actually looks like when you scavenge it out of the bblocks of an unsuspecting program.

Obviously, once you have such a VM defined, you can compile arbitrary exploits to it. It's like having a scriptable debugger attached to the remote program.

You should read the paper because it's an excellent crash course in runtime exploit design and mitigation, and a good way to jog your x86 memory. But I should also note that I haven't done justice to the paper: it's thesis is that you can not only do all these things, but do them without the "ret" instruction, or any other non-innocuous sequence of instructions.

Re:Return-Oriented Programming without Returns (on the x86) by ax0n on Saturday February 27, 2010 @06:03PM (#1155995)
I don't mind reading about programming, startup politics, etc. but things like this paper and the aforementioned javascript ![:alnum:] thread are the things I love the most on HN.

I also love how much really good intelligent discussion happens here on things like PDFs that don't have a built-in commenting system.

So, thanks!

Re:Return-Oriented Programming without Returns (on the x86) by bigmac on Saturday February 27, 2010 @10:47PM (#1156388)
Thomas, have you seen or heard of any real life exploits utilizing return oriented programming? Its a really really cool idea, but it seems that once you've got memory corruption, there are easier ways to get arbitrary code execution than return oriented programming.
Re:Return-Oriented Programming without Returns (on the x86) by __bjoernd on Sunday February 28, 2010 @05:25AM (#1156715)
They definitely showed that this approach can be used in a real-life scenario last year, when they broke some voting machines using ROP.

http://www.scienceblog.com/cms/computer-scientists-take-over...

Re:Return-Oriented Programming without Returns (on the x86) by swolchok on Sunday February 28, 2010 @05:58PM (#1157624)
It's been done on sensor motes too. http://planete.inrialpes.fr/~francill/Papers/Code_Injection_...

It's not surprising that it's practical; it's basically just a souped up ret2libc attack.

Re:Return-Oriented Programming without Returns (on the x86) by arohner on Saturday February 27, 2010 @06:14PM (#1156000)
IANA security expert, but stuff like this makes me believe it is never possible to secure native code. If you want a secure system, build a VM using a strict language like Haskell.

Is that a fair statement?

Re:Return-Oriented Programming without Returns (on the x86) by tptacek on Saturday February 27, 2010 @07:30PM (#1156119)
It would be fair to sum up much of security and vulnerability research over the last 15 years as "trying to answer whether it's possible to secure a runtime when an attacker has limited but unanticipated access to raw memory". The weight of the evidence says "no", but secure runtimes are in their infancy (look at Google NaCL for a recent example).
Re:Return-Oriented Programming without Returns (on the x86) by ax0n on Saturday February 27, 2010 @06:26PM (#1156019)
I am a security professional, but not a developer. You're half correct. Your suggestion of a VM with Haskell would result in a system that could still be made to fail. The methodologies would just work differently.
Re:Return-Oriented Programming without Returns (on the x86) by ramchip on Saturday February 27, 2010 @09:11PM (#1156254)
Could you back up that claim? lambdabot on #haskell runs arbitrary Haskell code very safely.
Re:Return-Oriented Programming without Returns (on the x86) by jrockway on Saturday February 27, 2010 @11:01PM (#1156406)
I think he means fail as in allowing you to write a function like:

  deleteAllFiles user = if user == Root
                           then throwError "access denied"
                           else unsafeDeleteAllFiles
Even if memory access is safe, you can still type in the wrong algorithm.
Re:Return-Oriented Programming without Returns (on the x86) by ax0n on Saturday February 27, 2010 @11:56PM (#1156462)
Most certainly. But further, it's possible to write unintentionally exploitable code in any language.
Re:Return-Oriented Programming without Returns (on the x86) by ax0n on Saturday February 27, 2010 @10:19PM (#1156353)
No, because I know absolutely nothing about Haskell. I do know that if there was a silver-bullet language that was 100% "secure", everyone would be using it.

This attack is x86 machine-code-native, so Haskell in a VM is not vulnerable to the exact same problems, but to assume it's completely invulnerable is myopic.

Re:Return-Oriented Programming without Returns (on the x86) by jpr on Sunday February 28, 2010 @02:22AM (#1156600)
> I do know that if there was a silver-bullet language that was 100% "secure", everyone would be using it.

This is completely false. Almost nobody in the software industry cares about safety. This can be proven trivially just by comparing how much more popular C and C++ are compared to memory-safe languages.

Re:Return-Oriented Programming without Returns (on the x86) by tedunangst on Sunday February 28, 2010 @02:39AM (#1156609)
If you want a secure system, you'll have to answer how is the secure Haskell VM different than the "secure" Java VM, or Python VM, or Flash VM?
Re:Return-Oriented Programming without Returns (on the x86) by jules on Saturday February 27, 2010 @07:00PM (#1156071)
No, you only need memory safety. Other than that you can make your language as crazy as you want.
Re:Return-Oriented Programming without Returns (on the x86) by yacin on Saturday February 27, 2010 @07:24PM (#1156114)
Memory safety _can_ be compromised in a cool, albeit unlikely, scenario: http://www.cs.princeton.edu/~sudhakar/papers/memerr.pdf

But for all practical purposes, you're right :)

Re:Return-Oriented Programming without Returns (on the x86) by tbrownaw on Saturday February 27, 2010 @10:02PM (#1156329)
1) wow, that is seriously awesome

2) hey, maybe we can get the music and film industry associations to mandate ECC as part of the license requirements for their next big DRM scheme

Re:Return-Oriented Programming without Returns (on the x86) by jrockway on Saturday February 27, 2010 @11:00PM (#1156404)
In case you were hoping #2 would lower the price of ECC memory, it won't. ECC memory is the same hardware as regular memory, you just have more of it; 4GB of ECC memory is just 7GB of regular memory with a different sticker on it. Since most people decide how much memory to get based on the price ("I'm willing to spend $100 on memory"), demand would remain unchanged.
Re:Return-Oriented Programming without Returns (on the x86) by tbrownaw on Tuesday March 02, 2010 @10:37PM (#1163295)
Yeah, I know the price wouldn't change much. The real benefit I see is that Intel would have to stop disabling the ECC support on their desktop chips, and I'd have more choices available next time I'm up for a new computer.
Re:Return-Oriented Programming without Returns (on the x86) by jules on Sunday February 28, 2010 @03:45PM (#1157432)
Very cool! Purity doesn't help defend against that either, unfortunately.