8 ms·
Spectre in JavaScript
- JoachimSchipper 6y agoThis is effectively a demo for https://news.ycombinator.com/item?id=26436515 https://news.ycombinator.com/item?id=26436515.
- feross 6y agoIt's actually a demo for it. It's linked from the post.
- tillinghast 6y agoFriday afternoon, I was really kind of looking forward to https://en.wikipedia.org/wiki/Spectre_(1991_video_game) https://en.wikipedia.org/wiki/Spectre_(1991_video_game)
- sircastor 6y agoWell, this steps up the game quite a lot. I’d considered the CPU attacks relatively unconcerning because it required executing code locally. Bring able execute from a web page makes for a broader attack vector.
- gbrown_ 6y agoJavaScript based examples are shown in the Spectre paper.
- anyfoo 6y agoYou have to specify a whole lot more context if you talk about executing code "locally" vs. executing "from a web page". JavaScript usually gets JIT'ed into machine language code. That code gets executed locally. There are usually a bunch of differences in terms of form and restrictions around that code, but this might well be a case where most of those differences don't matter. Or in other words, browsers are just compilers/interpreters like any other, albeit very hardened ones because of the large exposure of untrustworthy code they are subject to. But if an attack fundamentally skirts around sandboxes, the browser sandbox won't help. It's Turing machines all the way down.
- swiley 6y agoThis is not new and it's half the reason I browse the web in icecat/elinks. The other half being that most of the javascript out there is written without regard for resource consumption.
- paulryanrogers 6y agoWhat protections are unique to IceCat?
- saagarjha 6y agoPresumably the different kind of "security by obscurity" that comes with using software that nobody else uses and thus nobody will spend resources targeting
- warkdarrior 6y agoAs far as I can tell, IceCat uses the same rendering and Javascript engines as Firefox, so it'll have the same security issues as Firefox.
- bullen 6y agoTo me this changes nothing to the 30% CPU wasted by default with new linux distributions. Linus said he wanted the workarounds disabled by default, why didn't anyone listen? I'm not browsing javascript sites on my linux server!? If the server is compromised they don't need to use meltdown/spectre to do damage since servers need root for everything useful (open port <1024)?!
- lrvick 6y agoNo, but someone that finds even an unprivileged path to execute code on your server can fully control root on it if spectre is carried out successfully.
- deleted 6y ago[deleted]
- paulryanrogers 6y agoDistros probably want to fail safe. That said most desktop installs are probably single user, so should be safe to do there
- Delk 6y agoWouldn't exploits from JavaScript specifically mean that single-user desktops aren't necessarily safe?
- paulryanrogers 6y agoYeah, I didn't recall the Javascript case until it was too late. Though I thought all browsers had reduced their timing precision to mitigate that.
- mhh__ 6y agoAnd what happens if they work out enough about your server to use ROP?
- toomim 6y agoThis doesn't run in Safari on an M1. I'm getting is error in the JS console: [Error] RuntimeError: Out of bounds memory access (evaluating 'this.wasm.exports.oscillateTreePLRU2') <?>.wasm-function[2] (memory_frame.html:78) wasm-stub oscillateTreePLRU2 _timeL1 (memory_frame.html:78) leakMeTestSet (memory_frame.html:146) Global Code (memory_frame.html:165)
- AndroidKitKat 6y agoSame error on my Intel MacBook running Safari
- sss111 6y agoYep same here, Safari on Intel Macbook. However, it runs perfectly in Chrome. More reason to use Safari I guess
- ddworken 6y agoWhile this POC may not reliably work on Safari, it is worth noting that from a defense perspective Safari is missing site-isolation (which Chrome, Edge, and soon Firefox all have). So if an attacker were to get this to work on Safari, the impact would be potentially much greater in terms of what could be stolen.
- sss111 6y agoDid you select the "M1 CPU" checkbox? Just making sure
- toomim 6y agoSo given that the only mitigation to Spectre is to isolate each website into its own underlying OS process, it seems very important to know which browsers are doing that. Chrome is doing it. What about Firefox and Safari? What about Edge? Do they implement site isolation?
- Paul-ish 6y agoThe proof of concept is in Chrome, so it appears Chrome's mitigations are not sufficient.
- toomim 6y agoNo, the POC only shows the script leaking memory into javascript running within the same process, and thus the same site. Chrome is still preventing the info from leaking across sites.
- jeffbee 6y agoThat's why there was the recent W3C draft about Spectre and the policies around which sites can frame other sites.
- ddworken 6y agoThe big caveat to this is that an attacker can generally get a browser to include a cross-site resource in their process. For example, `<img src="https://sensitive.com/myprofilepic.png https://sensitive.com/myprofilepic.png">` will cause the image to be loaded in the attacker's process where they can then potentially steal it. The article "Post-Spectre Web Development" goes into details on how sites can defend against this (and other vectors).
- eloff 6y agoNo, the attack always works, whether there's an isolated process or not. In Chrome's design you shouldn't be able to access any data of value with the attack, that is data from other sites (like cookies) or privileged data. I don't know if that's indeed true or not in Chrome, but that's why it was designed that way.
- bstar77 6y agoI didn't experience the issue on my Threadripper2 with Windows 10. Is that because of OS patches or because my CPU is not affected?
- unnouinceput 6y agoDefinitely OS patch. Currently neither Intel nor AMD have Specter free CPU's. And one would be in like a few years on the market. Until then it's OS patches as protection, and you know very well the history of those :).
- swiley 6y agothis doesn't work on my pinephone although my hands are pretty sweaty now.
- AzzieElbab 6y agoNow I am become Death.js, the destroyer of worlds
- the8472 6y agoAttempting to take those cache timings in FF doesn't result in anything like the demo. https://a.pomf.cat/gawfxu.png https://a.pomf.cat/gawfxu.png
- brianush1 6y agoFrom what I understand, Firefox has a lower precision timer, which means you need to do more cache timer repetitions; try increasing it to 400,000, it should look more like the demo (though it still doesn't generate two entirely separate curves).
- SquareWheel 6y agoChrome worked to re-enable precise timers after implementing a number of mitigation strategies. They could always lower precision again, if necessary. Though it's unfortunate how much progress and performance we've lost to Spectre. Interestingly the Chromium blog posted about mitigating side-channel attacks just earlier today. https://blog.chromium.org/2021/03/mitigating-side-channel-attacks.html https://blog.chromium.org/2021/03/mitigating-side-channel-at... The Google Security blog also has a writeup on this PoC. https://security.googleblog.com/2021/03/a-spectre-proof-of-concept-for-spectre.html https://security.googleblog.com/2021/03/a-spectre-proof-of-c...
- erights 6y agoMeltdown and Spectre are serious. But we need clarity on what they do and do not threaten. To address the widespread confusion on this topic, and to demonstrate a completely different approach to mitigating these, we wrote: https://agoric.com/taxonomy-of-security-issues/ https://agoric.com/taxonomy-of-security-issues/ and https://ses-demo.netlify.app/demos/challenge/ https://ses-demo.netlify.app/demos/challenge/
- garganzol 6y agoEnjoyed the article. Thanks for sharing. It is more on a scientific side though, but this is exactly what I like to see when it comes to system analysis and security.
- sp332 6y agoIronically, I could only get this to work in Edge (the new Edge which is Chromium underneath) by turning down the "Cache timer repetitions", the thing which is supposed to make timing differences more discernible. At only 500, it works every time. If I crank it up to 5000, it doesn't work at all.
- eptcyka 6y agoDoesn't do anything on Firefox on a pixel 3.
- jgowdy 6y agoI often bring this up in HTTP vs HTTPS conversations. It's not about what CAs you trust, as that's a policy decision you can make on your own devices. It's about knowing (through whatever CAs you trust), what the origin of the code you're going to execute on your device is. It's about knowing that your ISP isn't injecting extra JavaScript into your page requests. This isn't hypothetical, it's literally happening right now. When the people injecting JavaScript are interested in exploits rather than dumb ISP value added services and notifications, it becomes more obvious that running code from untrusted sources, even if it's sandboxed, is dangerous.
- bullen 6y agoI think you are confusing HTTP which is a protocol and the browser which is doing more than just HTTP. I'm using HTTP securely just fine when I connect to it with my own client and my own encryption! Servers don't use browsers. We don't need HTTPS, we need less complexity and HTTP is just fine for transport!
- joana035 6y agoTested this page in 3 different systems (1 AMD, 2 Intel) and it didn't work under Firefox (which is good).