Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Issue 299253003: [webcrypto] Only allow crypto.subtle.* to be used from "secure origins". (Closed)

Created:
6 years, 7 months ago by eroman
Modified:
6 years, 6 months ago
CC:
abarth-chromium, blink-reviews, Ryan Sleevi
Visibility:
Public.

Description

[webcrypto] Only allow crypto.subtle.* to be used from "secure origins". The meaning of a secure origin is defined by: http://www.chromium.org/Home/chromium-security/security-faq#TOC-Which-origins-are-secure- In essence, "secure origins" are those that load resources either from the local machine or over the network from a cryptographically-authenticated server. For example these are considered secure origins: * chrome-extension://xxx * https://xxx * wss://xxx * file://xxx * http://localhost/ * http://127.0.0.1/ Whereas these are considered insecure: * http://foobar * ws://foobar crypto.subtle itself is visible from insecure origins. However all of its methods will fail by returning a rejected Promise for NotSupportedError. BUG=373032, 245025, 362214 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175916

Patch Set 1 #

Total comments: 5

Patch Set 2 : Address palmer's review comments #

Patch Set 3 : reformat comments #

Total comments: 1

Patch Set 4 : Add tests for filesystem and blob URLs, and comments on data: URLs #

Patch Set 5 : Clean up some comments #

Total comments: 9

Patch Set 6 : Address abarth comments, and test for 127.0.0.1/8 #

Patch Set 7 : ensureCanAccessWebCrypto --> canAccessWebCrypto #

Patch Set 8 : Add more tests #

Total comments: 4

Patch Set 9 : Address abarth comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -1 line) Patch
M Source/modules/crypto/SubtleCrypto.cpp View 1 2 3 4 5 6 7 chunks +30 lines, -0 lines 0 comments Download
M Source/platform/DEPS View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/weborigin/SecurityOrigin.h View 1 2 3 4 5 3 chunks +11 lines, -1 line 0 comments Download
M Source/platform/weborigin/SecurityOrigin.cpp View 1 2 3 4 5 6 7 8 3 chunks +30 lines, -0 lines 0 comments Download
M Source/platform/weborigin/SecurityOriginTest.cpp View 1 2 3 4 5 6 7 1 chunk +75 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
eroman
Chris, could you give this a look over before I get Blink folks to review? ...
6 years, 7 months ago (2014-05-23 22:52:51 UTC) #1
eroman
s/cpalmer@/palmer@
6 years, 7 months ago (2014-05-23 23:17:23 UTC) #2
palmer
LGTM with nits. https://codereview.chromium.org/299253003/diff/1/Source/modules/crypto/SubtleCrypto.cpp File Source/modules/crypto/SubtleCrypto.cpp (right): https://codereview.chromium.org/299253003/diff/1/Source/modules/crypto/SubtleCrypto.cpp#newcode70 Source/modules/crypto/SubtleCrypto.cpp:70: SecurityOrigin* origin = scriptState->executionContext()->securityOrigin(); Can |origin| ...
6 years, 7 months ago (2014-05-24 01:44:29 UTC) #3
eroman
https://codereview.chromium.org/299253003/diff/1/Source/modules/crypto/SubtleCrypto.cpp File Source/modules/crypto/SubtleCrypto.cpp (right): https://codereview.chromium.org/299253003/diff/1/Source/modules/crypto/SubtleCrypto.cpp#newcode70 Source/modules/crypto/SubtleCrypto.cpp:70: SecurityOrigin* origin = scriptState->executionContext()->securityOrigin(); On 2014/05/24 01:44:30, Chromium Palmer ...
6 years, 7 months ago (2014-05-24 02:08:57 UTC) #4
eroman
@abarth: Would you be able to review this? Also if you have any advice on ...
6 years, 7 months ago (2014-05-24 02:11:42 UTC) #5
eroman
Changing reviewer to Darin. @darin: Please see question in comment #5 (guidance on how to ...
6 years, 6 months ago (2014-05-28 20:44:25 UTC) #6
darin (slow to review)
On 2014/05/28 20:44:25, eroman wrote: > Changing reviewer to Darin. > > @darin: Please see ...
6 years, 6 months ago (2014-05-28 21:38:03 UTC) #7
eroman
Yes, would need control over hostnames not just the ports. Chrome already has such a ...
6 years, 6 months ago (2014-05-28 23:59:07 UTC) #8
darin (slow to review)
https://codereview.chromium.org/299253003/diff/40001/Source/platform/weborigin/SecurityOriginTest.cpp File Source/platform/weborigin/SecurityOriginTest.cpp (right): https://codereview.chromium.org/299253003/diff/40001/Source/platform/weborigin/SecurityOriginTest.cpp#newcode82 Source/platform/weborigin/SecurityOriginTest.cpp:82: // Access is granted to all secure transports. What ...
6 years, 6 months ago (2014-05-29 05:08:14 UTC) #9
eroman
Thanks for pointing out the missing tests for filesystem and blob URLs! Added tests for ...
6 years, 6 months ago (2014-05-29 22:23:53 UTC) #10
palmer
LGTM.
6 years, 6 months ago (2014-05-30 19:15:58 UTC) #11
eroman
@darin: ping
6 years, 6 months ago (2014-06-03 15:33:28 UTC) #12
eroman
Ping (need a Blink OWNER to look) ;)
6 years, 6 months ago (2014-06-06 20:24:04 UTC) #13
abarth-chromium
https://codereview.chromium.org/299253003/diff/70001/Source/modules/crypto/SubtleCrypto.cpp File Source/modules/crypto/SubtleCrypto.cpp (right): https://codereview.chromium.org/299253003/diff/70001/Source/modules/crypto/SubtleCrypto.cpp#newcode84 Source/modules/crypto/SubtleCrypto.cpp:84: if (!ensureCanAccessWebCrypto(scriptState, result.get())) ensureCanAccessWebCrypto -> canAccessWebCrypto https://codereview.chromium.org/299253003/diff/70001/Source/platform/weborigin/SecurityOrigin.cpp File Source/platform/weborigin/SecurityOrigin.cpp ...
6 years, 6 months ago (2014-06-06 20:36:35 UTC) #14
eroman
PTAL. I addressed the FIXME for testing of 127.0.0.1/8 and added corresponding tests. https://codereview.chromium.org/299253003/diff/70001/Source/platform/weborigin/SecurityOrigin.cpp File ...
6 years, 6 months ago (2014-06-10 01:00:11 UTC) #15
abarth-chromium
lgtm https://codereview.chromium.org/299253003/diff/130001/Source/platform/weborigin/SecurityOrigin.cpp File Source/platform/weborigin/SecurityOrigin.cpp (right): https://codereview.chromium.org/299253003/diff/130001/Source/platform/weborigin/SecurityOrigin.cpp#newcode41 Source/platform/weborigin/SecurityOrigin.cpp:41: #include <url/url_canon_ip.h> #include "url/url_canon_ip.h" You should probably also ...
6 years, 6 months ago (2014-06-10 17:09:12 UTC) #16
eroman
Thanks for reviews! https://codereview.chromium.org/299253003/diff/130001/Source/platform/weborigin/SecurityOrigin.cpp File Source/platform/weborigin/SecurityOrigin.cpp (right): https://codereview.chromium.org/299253003/diff/130001/Source/platform/weborigin/SecurityOrigin.cpp#newcode41 Source/platform/weborigin/SecurityOrigin.cpp:41: #include <url/url_canon_ip.h> On 2014/06/10 17:09:11, abarth ...
6 years, 6 months ago (2014-06-10 18:47:27 UTC) #17
eroman
The CQ bit was checked by eroman@chromium.org
6 years, 6 months ago (2014-06-10 18:47:32 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eroman@chromium.org/299253003/150001
6 years, 6 months ago (2014-06-10 18:48:26 UTC) #19
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: mac_blink_rel on tryserver.blink ...
6 years, 6 months ago (2014-06-10 19:56:06 UTC) #20
commit-bot: I haz the power
6 years, 6 months ago (2014-06-10 20:30:22 UTC) #21
Message was sent while issue was closed.
Change committed as 175916

Powered by Google App Engine
This is Rietveld 408576698