4 ms·
I think it's possible that TLS is functional, but getRandomValues is hacked/broken. A popular browser extension sold or given away to a hacker could inject ever
by speedgoose 5y ago
I think it's possible that TLS is functional, but getRandomValues is hacked/broken. A popular browser extension sold or given away to a hacker could inject everywhere the following code for example:
window.crypto.getRandomValues = (arrayBufferView) => arrayBufferView.fill(4);
For sure using more entropy from JS will not do much in case of a targeted attack that did compromise the downloaded code or the runtime, but the scenario of a larger scale attack on WebCrypto is what I was thinking about.
- dchest 5y agoIf an extension can modify getRandomValues, then all your other code is also untrusted, you can't work around it by using other methods to generate randomness.
- speedgoose 5y agoI know. But the likelyhoood of a targeted attack on my code is much lower.