Intel Core 2 Duo Remote Exec Exploit in JavaScript?
1337day.com
1337day.com
There's all kinds of bizarre silliness in the "exploit". They're passing URL-encoded x86 assembly to unescape() in a void context, as if that'll somehow execute the code in the result. (This technique is sometimes useful in heap sprays, but they aren't using it in a way that would work for that -- in particular, they aren't creating NOP slides or saving the result anywhere, so the resulting code would be almost impossible to hit.) They're claiming to have a "microcode VM" with a "scrambler + dynamic encoder + multi-pass obfuscator", but no such thing is in evidence. There's sillier things still, but I'll leave it for now.
I've run the PoC code, because I don't see anything to fear, and, as expected, it does nothing. The "Check vuln" button always returns "your CPU isn't buggy", because it's simply checking that the "test()" function returns 1 (which it does), and the "PoC Run!" button throws an exception, because it ends up assigning "[object Object]NaN" to the global "unescape" and attempting to call it. There is no way in hell that this code could ever have anything resembling the intended effect, on any Javascript interpreter, platform, or architecture.
The author responded to detractors on twitter by posting a link to the C proof-of-concept that he was apparently attempting to translate into javascript:
The C source is definitely what the javascript is based off of, but the modifications (even if for "protection against lamers") are puzzling to say the least.
Source: Author's twitter: http://twitter.com/sanjar_satsura
You'd need to overcome address space randomization but apparently there are reflection techniques that allow that to some extent.
In any case, I'd wait for confirmation from a white hat researcher who knows their shit, but I wouldn't reject out of hand that this is possible from javascript. CPU logic exploits are quite a different beast from the more common buffer overflows or OS flaw exploits.
The memory access part is definitely doable from JS. Multiple threads is harder -- you might be able to do it by using web workers. Targeting memory access to a JIT-compiled function, however, would be the hard part; I don't see any way of doing that, short of executing the function (which would probably not have the desired effect).
No clue if this is the case.
Where are your pointers, ASM registers in js? The claim you could inject arbitrary code from JS into your memory and make it executable from user space (not talking of the cross platform issue (BSD,linux, windows, MACOSX) would just be the end of JS.
How can you even accept the claim that it can be doable. Be real. This news is like an april's fool in july.
Use your brain.
> The claim you could inject arbitrary code from JS into your memory and make it executable from user space
One of the dozens of ways that you would go about this is documented in some detail here: http://stackoverflow.com/questions/381171/help-me-understand...
[1]: http://blogs.msdn.com/b/oldnewthing/archive/2010/12/08/10101...
Why God these stupid Larry Wall, GvR, MS, Sun, Google, linus torvalds lost their time trying to achieve what a JS code can do in less than 1000 lines?
How can I believe a code I can read and that is obviously a fraud would through the sheer power of obfuscated unused strings become such a revolution in the world of CS?
Plus, I have no demonstration nor readable documents to back up the claims of this so called genius.
Science is accepting what you can understand and reproduce. Not being impressed by obfuscated crap.
I have no doubt this is a mystification, and I don't trust blindly what is written on the internet. I still have a brain.
The exploit described in stackoverflow, works only for IE and a version of windows where the memory addresses are not randomized (which most modern OS do have (http://en.wikipedia.org/wiki/Address_space_layout_randomizat...) , and where calc.exe is installed (so windows + IE probably).
Hint MOV + JMP are made @ fixed address.
If the code showed is not an hoax (which I highly doubt) it would imply : 1) a specific browser (to break the gate of OS control on memory/permission by using a buffer overflow) and I don't see at first glance a buffer overflow (but let's imagine it exists), 2) a specific old OS (windows 98 or XP maybe) (for having a predictable address to which to inject the shell code)(I can't imagine an ASM code doing base of registry scanning in less than 4k to get an address of a peculiar exec/lib); 3) since it is based on specific 64bits alignment problem and since there are 32bits legacy application) it would target only the 64bits version
This makes the threat looks more like ripples in a glass of water than the tsunami that was announced.
Basically this (if it is not the hoax I think it is) would be just an exploit of a specific browser in 64bits version on a specific OS. It is not a JS exploit, it is a very specific browser name on OS name exploit in 64bits. So to say ... the whole day life in the world of software.
> How can you even accept the claim that it can be doable.
Isn't exactly this how most/all heap spray js exploits work?
I wouldn't be so quick to dismiss the concept of this bug, even though the "poc" presented here is bogus.
But this case does raise an issue for NaCl (which I hope will become reality one day) where you have the granularity to mess with cache hits.
If this works as advertised, then if you have an affected CPU, it is a zero-day exploit affecting every web browser on every operating system, both desktop and mobile, as long as you have Javascript enabled. Until a workaround has been found, any site which serves you Javascript or any of its advertising networks could use it to give you malware.
If you are using Noscript and also blocking Flash, then you are probably safe. To protect yourself, you should, first of all, use ad-blocking software, because ad networks are more likely to distribute malware than the sites they advertise on. Second, you should use only the most security hardened browser, which is Google Chrome; it's not clear whether Chrome's hardening will actually help, but it's likely that it will, and also that it will be the first to have a workaround. And third, you should be immediately suspicious if your browser crashes unexpectedly.
Even taking C code and running it through two different compilers (or the same compiler with different options) will often produce different executable code. So one would assume each JavaScript JIT compiler would produce code differently, and yet there's no comment on what browsers are vulnerable?
Did I miss the memo that all of the above compilers are sharing the same JIT code?
Poe's law! Poe's law!
The bizarrely written code (no, really, read it) does not do anything useful as is; even bypassing the apparently intentionally erroneous JS, the best I can tell is that it's expecting you to modify your JS interpreter to make "unescape" execute the shellcode contained in the string, which makes it not a "remote exploit" but a (potential) local exploit someone stuck into an HTML page for some ridiculous reason.
and if you want to read the actual bug in Intel documentation, it is here: ftp://download.intel.com/design/processor/specupdt/313279.pdf
Additionally, AI39 doesn't even affect any of the CPUs they tested on! It affected some early Conroe steppings, but the Core2 (T5750) they tested on was Merom, released several years later, and the Atom is a completely different µarch altogether.
If I understand this bug correctly, then no you are not. My initial impression is that it is loading a specific sequence of bytes into memory than is then mistakenly executed by the CPU.
You don't need javascript to put bytes into memory.
It could be they need javascript to cause some sort of memory (string) copy at the same time.
Cite, please.
http://www.pcworld.com/businesscenter/article/245856/chrome_...
Summary:
* Study (commisioned by GOOG but methodology is open for inspection) puts them #1 out of 3 (being IE and Firefox)
* Patched faster and more often than others
* Untouched at least year's pwn2own
Edit: Oddly enough, this was the #1 result for "chrome most secure browser" on Google. One should really do a cursory search before throwing the citation flag.
Chrome might be safer (than Safari, Firefox or IE) for this kind of malware, but I sure as hell wouldn't run a browser made by an company that makes money by collecting personal data for the benefit of advertisers if I wanted to be "safe". I see no reason to believe Microsoft, Apple or Google haven't put some spyware/backdoor in their browsers. But I really don't care about it, so I use Safari which is the best browser on Mac, IMO.
That said, while Safari is a nice browser, it's horribly insecure. Just looking at Pwn2Own, it gets killed straight off every year, and those involved usually remark about how trivial it is.
That's so '11... ;-)
> Team VUPEN: 0day: Google Chrome: Full sandbox escape and code execution
http://pwn2own.zerodayinitiative.com/status.html
Safari was apparently the only one without a 0day, though exploited via CVE-2011-0115 and CVE-2010-0050, weird since the former is patched since 5.0.4 [0] and the latter is fixed in iOS 3.1.3 [1] and Safari 4.0.5 [2]. Aren't they supposed to target fully patched, latest OSes and browsers?
[0] http://support.apple.com/kb/HT4566
No, it's up to the people making the claim to defend it.
> Patched faster and more often than others
Not necessarily a good thing. Also doesn't really help people off of Google's forced-update scheme.
Also, plugins are an important part of any browser now; NoScript and the ad blocking/anti-tracking tools work better on Firefox.
However, should someone else provide a citation, then this will also do - and the author should really thank that person for doing the hard work in providing a more meaningful discussion.
Perhaps, but it adds much more to the discussion and comes across as less prickish if you say something along the lines of "I don't see any data to support that, could I see yours?" rather than "Citeplz".
Especially when it's literally one google search away on result #1. It just smacks of laziness.
And while I agree with you on plugins, we're talking security. I was going by the study's methodology (which seems mostly sound).
Cite, please.
Cite, please.
The more I read HN, the more bewildered I get at the gullibility that seems to prevail amongst self called geeks and smart entrepreneurs.
Give me a rope please.
People think this is interesting. I voted it up. I have no idea if it's true. I don't think a up-vote has ever been code for "also, this is 100% true"
Sorry I'm so much more gullible than you.
This is clearly an hoax in the first form (JS exploit).
At most (if real) it is just an exploit of a specific browser (version) on a specific OS. If you go on «hacker» news, I am very surprised you have no IT culture. I suggest you should read http://www.newsoftheworld.co.uk/ if you want untrustworthy sensational news, and consider not upvoting when you are clueless on a topic.
Less noise, more signal is a very old hacker motto. You obviously don't get it.
I have been trying to follow along but I'm confused why anything happens.
There's a test button that calls ThreadProc_dbg(bug) which then calls test(result), which in turns has some assembler code commented out and finishes with:
unescape('%u31C9%u5589%uE55D%u2EF8%uC390%u9090');
return 0;
The variable 'result' is (visibly) untouched by the function but ThreadProc_dbg tests its value to see if the processor is vulnerable or not. So just the test() function has the good stuff. (assuming it works) So either the assembler code does something even though it's commented out, or the unescape is not happy but I'm not sure why…I haven't tried too much on the code that actually crashing the computer (or whatever it does) since just the test puzzles me.
Actually it is invisibily touched by that call to unescape(). The assembly code in the comments is what is generated by the interpreter, and that's where the trick happens.
There is no obvious attempt to actually get the JS engine to do anything out of the ordinary. The string '%u31C9%u5589%uE55D%u2EF8%uC390%u9090'
is simply the unicode escaped version of the assembly above. The goal of this exploit would be to get the interpreter to set PC to the address of that string. There is no obvious attempt to do that.
Just compare the decoded opcodes in the DISASM comment to the contents of the string.
See my analysis: http://news.ycombinator.com/item?id=4246338
This test code is save for c2d users to try. It just checks, if the cache modification is possible.
A real exploit would combine this with other explotation code and would change the machine code of the test loop into a jump or a call.
The real scary part of this is, that it is possible to patch code despite of access rights. If the loop is really changed, I have no doubt that this can be made into an effective exploit.
(The PoC as it is doesn't actually do anything...)
Off topic, but one person being intelligent in a field you're potentially not familiar with does not make you "not smart". Putting yourself down isn't cool or honorable.
That being said, I'm also extremely curious what's going on here :)
I'm dumbfounded at how much more clever and sophisticated attacks get. It will never end! I fear that I cannot be of much use anymore.
I remember back when buffer overflows was the exploit and I viewed it as some kind of sorcery, even though I understood it.
I guess so long as software keeps getting written, exploits can be found, and if you plumb the depths of specification, you can find holes, but they're so much more harder to find now. :(
Maybe I'm feeling my age? Security is a game for the young? Or at least more energetic.
This is on par with some 90s hoaxes claiming some emails could burn your CPU.
The code isn't even hard to follow AT ALL! There is no way it will ever display anything but "<h1>[-] your CPU isn't buggy!<h1>". There is like 5 lines of very simple code to read to achieve this conclusion.
Very disappointed in Hacker News.
As for the Hacker News reaction, whether the exploit actually works is somewhat immaterial. Even if it doesn't, the story opens up new and interesting lines of thinking around CPU architecture and security. It's interesting hacker material even if there's no bug here.
Before I edited this comment, I had a laugh at the expense of people who think I'm in some way misguided for using NoScript and complaining when sites break with JavaScript off. That was wrong. I think that those critics are also wrong, though, and this sort of thing is why. Even if this particular code is a non-starter, the plausibility of this kind of threat, this kind of nightmare scenario, is a huge problem. JavaScript is a general-purpose programming language that's present on nearly every user-facing computer in the world, with all the security issues that come with that. It is in some ways the world's biggest and most-rewarding malware attack surface. A working 0-day attack in JavaScript itself could be worth millions or billions in the right hands.
[0] https://developers.google.com/v8/design#mach_code
[1] http://www.webkit.org/blog/214/introducing-squirrelfish-extr...
There's nothing that I see that makes it obvious that it's attacking the JIT logic specifically. It's most reminiscent of the fairly old heap spray techniques which require an additional exploit anyway.
For instance the function for testing existence of the bogus microcode is: function test(result) { // giant comment explaining the asm used to test for the vulnerability unescape('%u31C9%u5589%uE55D%u2EF8%uC390%u9090'); return 0; }
Presumably the call to unescape is intended to convert the encoded shellcode into somthing useful. But there does not appear to be anything done to actually execute the shellcode. The historical way of doing this (blocked by DEP) is to fill the heap with copies of the string, and then use another exploit to jump into the heap at somewhere likely to contain your code. There are ways to bypass DEP, but this doesn't appear to try even that.
Honestly it looks like someone has simply taken the assembly used to the exploit, put it in a string (using numeric character escapes), and then done nothing else.
That it is referring to launching threads makes me wonder if this isn't just someone converting a pre-existing C program into something that at least parses as JS.
I'm curious why the HN title hasn't been updated yet.
There are substantial differences in the ways various Javascript VMs work, how and where they store strings, how code is compiled, etc. Would it work under Rhino? Firefox? Old Safari?
Since you can overwrite kernel memory all you need to do is change the uid of your process to 0, and then the OS will happily do whatever you want.
Alternatively just overwrite the address of a popular system call to a function that you prefer.
With a little metasploit code this thing should be completely cross platform.
Any one tested this ?
this is powerful but undirected. locations of important code have been randomized in your operating system for quite some time. if this technique even works, to turn it into an 'exploit' you would need to know the location of the code that you want to patch, and knowing this requires yet another exploit...
So it might be possible that some parts of the code match existing malware.