-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the security model for non-extractable keys? #269
Comments
The dichotomy here isn't quite accurate, although I understand it's well-intentioned. https://www.w3.org/TR/WebCryptoAPI/#security-developers attempts to address this overall concern, with this specific language:
We can see, then, that the boundary being defined is with respect to script access. That is, if one has a Thus, if one has the ability to execute script within Origin A (e.g. in order to perform Spectre attacks), then one can already exfiltrate the key to Origin B, by virtue of postMessage.
To the best of my knowledge, in all shipping implementations, key material is directly within the process memory space of the application. That is, "no hardening for Spectre". Given the shape of the API at present, it's almost certain that the overheads involved would simply encourage developers to use WASM more for this case (which, to be clear, is an entirely secure and appropriate solution, modulo Spectre, for most use cases). As it stands today, developers already report that the task overhead (as well as potential thread switches to ensure non-blocking of the JS main thread) are performance bottlenecks - IPC overheads would only further exacerbate this. |
Thanks for the detailed answer @sleevi! We will go for the same model then, where key material is directly within the process memory. |
We recently implemented
CryptoKey
and some relatedSubtleCrypto
APIs in Deno. We intentionally do not yet support non-extractable keys because we have some open questions about the intended security model. The main questions we are hoping you can clarify is if non-extractable keys are meant as a security or an obfuscation primitive.If they are meant as a security primitive in the age of timing side channel attacks like Spectre, it would not safe to store the underlying key material in the memory of the render process. All cryptographic operations and key storage would have to occur in a separate process. If it is only an obfuscation primitive, this approach would be ok.
Some more concrete questions:
The text was updated successfully, but these errors were encountered: