229 points · by jeffbee · 5y ago · 85 comments
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)?!
Nowadays, the focus going forward is much more on giving every piece the privileges it needs, and not have an "absolute privilege" entity. (Outside of the kernel, although even for that it's less and less true anymore.)
No. A million times no. Absolutely no. It is not. You are doing a disservice to actual real people when you take away what they own.
I own my hardware. I am root. I have absolute privileges. The idea that root has absolute privileges is the core if why I use Linux.
- there are lots of useful things you can do without root
- you don’t need root to bind to port numbers below 1024 on Linux, just CAP_NET_BIND_SERVICE
- when you do need root, you can usually drop it either partially or completely
How do you do that if you're not root?
And if you are building an executable with that capability, how do you enable your Makefile to set it?
I think we might need "CAP_SET_CAP_NET_BIND_SERVICE" as well.
In fact, I might want to allow a user to bind to port 200 only.
So in this case "CAP_SET_CAP_NET_BIND_SERVICE_PORT_200" is needed.
And here we see the inflexibility of the entire approach :)
> And if you are building an executable with that capability, how do you enable your Makefile to set it?
The goal is to bind without passing through root, not to never have root at all, so you could run the service with it as an ambient capability (supported by e.g. systemd). Or setcap as root after building.
> In fact, I might want to allow a user to bind to port 200 only.
Program with the capability on its file to check the user, bind the socket, drop the capability, and exec. (I’m sure something existing does that, but I don’t have one to recommend since I’ve never needed it.)
But there’s also iptables and friends as alternative solutions to the same problem that still don’t require giving the process root at any point.
Can you combine that with nohup?
nohup setcap 'cap_net_bind_service=+ep' blabla...
You should probably run production services using something other than nohup, though, like systemd.
Interestingly the Chromium blog posted about mitigating side-channel attacks just earlier today.
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-c...
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.
[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)Chrome is doing it. What about Firefox and Safari? What about Edge? Do they implement site isolation?
On Chrome I have "too many false negatives" on 1st gen Ryzen.
My searching indicates firefox's performance.now precision is 20us, but the demo claims to be able to get timing differences of 2ms pretty easily.
EDIT: 20us precision might be outdated... running this repeatedly on osx and linux, I'm distinctly getting my results "bucketed" into whatever the unit on the x-axis is. Based on that, I'm guessing timer precision on firefox is actually 1ms.
Increasing the cache timer repetitions gets me to a smooth graph, but still no separation of the peaks.
The fact that I can get the graph to go from discrete buckets to smooth normal curves makes me think this can indeed overcome reduced timer precision
The fact that I can't get the peaks to separate makes me wonder if some other mitigation is protecting me.
That's pretty bad.
Or completely redesigning those aspects of CPU behavior to remove the ability for similar timing attacks.
You can still have branch prediction and caches, which is a very good thing, because not having those would cut the performance of modern CPUs to less than 1% of what it currently is.
That this is generally considered ok boggles the mind. That browser vendors have made it difficult for users to disable this is insane! Even MS Internet Explorer gave users at least that security tool!
People like you who want to turn js off are a very small niche. And you have better solutions. Run your browser in a remote server using rdp or vnc. I think it may be equally safe and you may actually have a larger chunk of web working for you.
https://agoric.com/taxonomy-of-security-issues/ and https://ses-demo.netlify.app/demos/challenge/
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.
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!
https://obscuritory.com/essay/incredible-boxes-of-hock-wah-y...