4 ms·
Another method is to limit access to timing mechanisms: https://www.infoq.com/presentations/cloudflare-v8 https://www.infoq.com/presentations/cloudflare-v8
by zackbloom 7y ago
Another method is to limit access to timing mechanisms: https://www.infoq.com/presentations/cloudflare-v8 https://www.infoq.com/presentations/cloudflare-v8
- tntn 7y agoTo which the V8 developers say: > We might consider adjusting the precision of timers or removing them altogether as an attempt cripple the program’s ability to read timing side-channels. > Unfortunately we now know that this mitigation is not comprehensive. Previous research [30] has shown three problems with timer mitigations: (1) certain techniques to reduce timer resolution are vulnerable to resolution recovery, (2) timers are more pervasive than previously thought and (3) a high resolution timer can be constructed from concurrent shared memory. The Amplification Lemma from Section 2.4 is the final nail in this coffin, as it shows (4) gadgets themselves can be amplified to increase the timing differences to arbitrary levels.
- xena 7y agoI have been looking at doing things like arbitrarily limiting the WebAssembly execution engine to only run an instruction per microsecond. This would then make full execution speed something programs have to be configured to do rather than something they get by default. I still don't know though, this stuff gets tricky. I think the ultimate goal for my implementation of this stuff is to remove anything higher than seconds resolution of time unless the program actually demonstrates a need for it. I'd like to have javascript and the browser processes be in separate machine processes, with javascript artificially only allowed to use 10% of the CPU time at max. Honestly I think that letting everything run at full speed on the CPU is probably a mistake.
- lioeters 7y ago> remove anything higher than seconds resolution of time unless the program actually demonstrates a need for it As someone working with Web Audio, I wonder if it's even possible to tell if a program "legitimately" needs milli/microseconds timing precision? Typically it'd be running on its own worker/audiolet(?) thread, but I imagine it could be exploited for some nefarious purpose. Edit: I realized the talk is about WASM on the server, but, who knows, maybe in the future it could also involve audio that needs high-precision timers.
- xena 7y agoYeah, my thought there is make resolution of timers a dependent capability. My ultimate goal is to let users be able to say "no, $APP doesn't need more than second resolution of timers", and if the user is wrong the app just has to deal with it.
- lioeters 7y agoThat makes sense. In browsers there are already restrictions around audio/video autoplay, as an example, and an application needs logic around waiting for user permission. So I can imagine something similar, where the default timer could be coarse, and high-resolution timing would require elevated privileges. Anyway, thank you for the notes/slides about WebAssembly on the server, fascinating stuff with a bright future!