by hobarrera · 9y ago · 0 comments
It's still possible for a sophisticated MITM to replace the JS code so that is DOES send the key somewhere.
"Your ProtonMail private key is stored encrypted on your browser using your mailbox password. It is sent to our servers in the encrypted form. The only time it is decrypted is when you correctly enter your mailbox password." [1]
[1] https://protonmail.com/support/knowledge-base/how-is-the-pri...
It is however going to be hard to prevent a malicious active attacker from stealing the passphrase.
The webcrypto api is still pretty cool though. I've been hoping for an excuse to use it sometime.
The webservice would assert that the resources it's sending now are the same resources it will continue to send in the future. The browser is in a prime position to enforce this.
In the event the resources ever change, then the browser should refuse to allow the changed resources to run and notifies the user what has happened in a way that is at least as scary as broken TLS. If it's a legit deployment (say, because the service has updated the backend), then this should be independently verifiable out of band e.g. via a blog post, a public changelog, etc. The process to accept the new deployment would need to be opt-in. If the user choices not to opt-in, the browser may continue using the old resources that were being served up in the past.
Without some mechanism like this, verification of the claims that services like ProtonMail makes remains intractable.
For the record one can already do it if all resources would use Subresource Integrity. Hashes of leaf resources would be embedded in parent resources up to the root document that you could announce out-of-band (e.g. https://example.com on 23rd of November 2017 has hash 1234566...). Then you'd have a cryptographic proof (like a Merkle tree) that nothing in the page changed.
Yes, but virtually nothing protects against proxying requests. Non-exportable keys protect against using them when the device is powered off.
> Also, if the server is malicious on the first connection, then the server could just not use the webcrypto api to begin with, and just make use a key that the server knows instead.
Agreed, but it's kind of like Trust On First Use. I guess it depends on one's trust model if they consider it a good trade-off.