window.crypto
Reported by
srikuma...@gmail.com,
Dec 16 2016
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36 Steps to reproduce the problem: 1. Load crypto.html in Chrome 2. You'll see "crypto's been pwned!" What is the expected behavior? You should see "crypto is safe. [object Crypto]" instead. What went wrong? The "window.crypto" property should not be "configurable". If it is, then it can be made temporarily writable and replaced with an implementation that can hijack all crypto calls for malicious purposes. The current value of Object.getOwnPropertyDescriptor(window, "crypto") is writable = false, enumerable = true, configurable = true. It should be writable = false, enumerable = true, configurable = false. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 54.0.2840.98 Channel: n/a OS Version: OS X 10.11.6 Flash Version: Shockwave Flash 24.0 r0
,
Dec 16 2016
Also, I expect the entire object tree under "window.crypto" to be non-configurable and non-writable - i.e. "frozen".
,
Dec 16 2016
Adding 'Needs-Milestone' label, TE will check the issue and update the bug with comments & tag with respective Mstone
,
Dec 19 2016
@srikumarks -- Thank You for the report. Navigated to the html file and observed the text, "crypto's been pwned!" The same behavior is being seen on Firefox also. Could you please re-check again and provide us the update. Thanks in Advance.
,
Dec 19 2016
Yes it is the same behaviour in Firefox too!
,
Dec 24 2016
For the record, the WebCryptoAPI specification (https://www.w3.org/TR/WebCryptoAPI/) does not seem to say anything specific about the attributes of window.crypto. While that would make the current implementation conformant, it certainly isn't safe for it to be configurable if web devs are expected to be able to trust it.
,
Jan 2 2017
Thank you for providing more feedback. Adding requester "msrchandra@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 9 2017
Could some one from Security team please look into the issue and update. Thanks in Advance.
,
Jan 17 2017
Able to reproduce the issue on the latest canary(57.0.2984.0) on Windows-10, Mac OS 10.12.2 and Linux Ubuntu 14.04. This is working the same on Firefox and IE. This changed behavior on Chrome in M-51. Last good build: 51.0.2680.0 First bad build: 51.0.2681.0 Changelog: https://chromium.googlesource.com/chromium/src/+log/342f187bb5ba4f9ec5e7f0ea4018f54b682922da..607c6e18aae50211a534f964ebfdac47cdbf21be Yuki@: Could this be related to https://codereview.chromium.org/1667653002
,
Jan 17 2017
+domenic@, do you have any advice on this issue? The current behavior is by-design and, as the reporter wrote in #7, the current implementation is conformant to the current spec. From this point of view, there is no problem. It's possible that the current spec is not secure and needs a fix, but I'm not sure. Given that you can run arbitrary script on the window (e.g. defineProperty), you can do anything in general not limited to window.crypto. If you're running a harmful script, it's too late. IMHO, making window.crypto unconfigurable doesn't help much. If the script were harmful, then that script can rewrite a whole page to do phishing for example. re: #10, my CL is not relevant and it's working fine by design. We can technically make window.crypto unconfigurable with one-line-change, but I don't think we need to do so so far.
,
Jan 17 2017
Yes, we should close this as working as intended. This is the wrong level at which to solve the problem. If people are running arbitrary script inside your web page, then you are already irretrievably insecure. You need to mitigate that through measures such as HTTPS, CSP (nonces etc.), and so on. The proper forum for this discussion is the web crypto spec repository, but I can guarantee they will give you the same answers.
,
Jan 18 2017
Understand. I've noted this as an issue in that repo - https://github.com/w3c/webcrypto/issues/169 Scripts can also run via browser extensions.
,
Jan 18 2017
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 Deleted