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

Issue 1220963004: Check the response URL origin in BufferedDataSource to avoid mixing cross-origin responses. (Closed)

Created:
5 years, 5 months ago by horo
Modified:
5 years, 5 months ago
Reviewers:
falken, hubbe, DaleCurtis
CC:
chromium-reviews, feature-media-reviews_chromium.org, serviceworker-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Check the response URL origin in BufferedDataSource to avoid mixing cross-origin responses. In current implementation malicious attackers can scan the bytes of cross-origin resources by mixing their generated bytes and the target response. See http://crbug.com/489060#c32 for details. To avoid this, we have to deny mixing cross-origin responses in the middle of playback. This CL introduces the check logic of the response URL origin of the partial responses. When BufferedDataSource receives the first HTTP responses, it remembers the original URL of it. And when BufferedDataSource receives the succeeding response, it checks the origin of the new response. If the origin is not same as the origin of the first response, the response is treated as an error. BUG=505829 TEST=media_blink_unittests with https://codereview.chromium.org/1221973002/, LayoutTests in https://codereview.chromium.org/1226473002/ Committed: https://crrev.com/7ab9c6c314f589251c85913bd0a360cba24eb76a Cr-Commit-Position: refs/heads/master@{#338620}

Patch Set 1 : #

Total comments: 8

Patch Set 2 : incorporated hubbe and falken's comment #

Total comments: 8

Patch Set 3 : Check Origin and canRequest #

Total comments: 11

Patch Set 4 : incorporated falken's comment #

Total comments: 2

Patch Set 5 : incorporated hubbe's comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -4 lines) Patch
M media/blink/buffered_data_source.h View 1 2 3 4 2 chunks +10 lines, -0 lines 0 comments Download
M media/blink/buffered_data_source.cc View 1 2 3 4 3 chunks +15 lines, -2 lines 0 comments Download
M media/blink/buffered_data_source_unittest.cc View 1 2 3 4 3 chunks +134 lines, -0 lines 0 comments Download
M media/blink/buffered_resource_loader.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M media/blink/buffered_resource_loader.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M media/blink/test_response_generator.h View 1 chunk +12 lines, -0 lines 0 comments Download
M media/blink/test_response_generator.cc View 1 chunk +14 lines, -2 lines 0 comments Download

Messages

Total messages: 43 (17 generated)
horo
falken@ Could you please review this?
5 years, 5 months ago (2015-07-01 13:28:31 UTC) #6
DaleCurtis
+hubbe
5 years, 5 months ago (2015-07-01 17:41:13 UTC) #8
hubbe
The description of this CL explains what it does, but not why. I tried looking ...
5 years, 5 months ago (2015-07-01 18:09:52 UTC) #9
falken
I'm not the best reviewer for this, but some nits. https://codereview.chromium.org/1220963004/diff/80001/media/blink/buffered_data_source.h File media/blink/buffered_data_source.h (right): https://codereview.chromium.org/1220963004/diff/80001/media/blink/buffered_data_source.h#newcode242 ...
5 years, 5 months ago (2015-07-02 01:04:08 UTC) #10
horo
On 2015/07/01 18:09:52, hubbe wrote: > The description of this CL explains what it does, ...
5 years, 5 months ago (2015-07-02 03:10:41 UTC) #13
horo
https://codereview.chromium.org/1220963004/diff/80001/media/blink/buffered_data_source.h File media/blink/buffered_data_source.h (right): https://codereview.chromium.org/1220963004/diff/80001/media/blink/buffered_data_source.h#newcode242 media/blink/buffered_data_source.h:242: // Service Worker this URL is empty. BufferedDataSource checks ...
5 years, 5 months ago (2015-07-02 03:10:49 UTC) #14
falken
non-owner lgtm https://codereview.chromium.org/1220963004/diff/140001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/140001/media/blink/buffered_data_source.cc#newcode409 media/blink/buffered_data_source.cc:409: // We don't support mixed range responses. ...
5 years, 5 months ago (2015-07-03 03:43:44 UTC) #15
falken
Actually I have some questions. https://codereview.chromium.org/1220963004/diff/140001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/140001/media/blink/buffered_data_source.cc#newcode408 media/blink/buffered_data_source.cc:408: response_original_url_ == loader_->response_original_url()) { ...
5 years, 5 months ago (2015-07-03 04:00:25 UTC) #16
falken
Sorry comment again... https://codereview.chromium.org/1220963004/diff/140001/media/blink/buffered_data_source_unittest.cc File media/blink/buffered_data_source_unittest.cc (right): https://codereview.chromium.org/1220963004/diff/140001/media/blink/buffered_data_source_unittest.cc#newcode111 media/blink/buffered_data_source_unittest.cc:111: static const char kHttpOtherOriginUrl[] = "http://127.0.0.1/foo.webm"; ...
5 years, 5 months ago (2015-07-03 04:02:45 UTC) #17
horo
https://codereview.chromium.org/1220963004/diff/140001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/140001/media/blink/buffered_data_source.cc#newcode408 media/blink/buffered_data_source.cc:408: response_original_url_ == loader_->response_original_url()) { On 2015/07/03 04:00:25, falken wrote: ...
5 years, 5 months ago (2015-07-06 11:45:48 UTC) #20
hubbe
https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc#newcode430 media/blink/buffered_data_source.cc:430: // If the SecurityOrigin of the frame can read ...
5 years, 5 months ago (2015-07-06 17:22:48 UTC) #21
horo
https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc#newcode430 media/blink/buffered_data_source.cc:430: // If the SecurityOrigin of the frame can read ...
5 years, 5 months ago (2015-07-07 01:06:47 UTC) #22
falken
I think this still looks lgtm https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc#newcode430 media/blink/buffered_data_source.cc:430: // If the ...
5 years, 5 months ago (2015-07-07 02:32:49 UTC) #23
horo
https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc#newcode435 media/blink/buffered_data_source.cc:435: // If the response is generated in a Service ...
5 years, 5 months ago (2015-07-07 03:48:37 UTC) #24
horo
hubbe@ Could you please review this? Thank you.
5 years, 5 months ago (2015-07-08 17:09:51 UTC) #26
hubbe
https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc#newcode430 media/blink/buffered_data_source.cc:430: // If the SecurityOrigin of the frame can read ...
5 years, 5 months ago (2015-07-08 18:13:23 UTC) #27
horo
https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc File media/blink/buffered_data_source.cc (right): https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc#newcode430 media/blink/buffered_data_source.cc:430: // If the SecurityOrigin of the frame can read ...
5 years, 5 months ago (2015-07-09 00:14:27 UTC) #29
horo
On 2015/07/09 00:14:27, horo wrote: > https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc > File media/blink/buffered_data_source.cc (right): > > https://codereview.chromium.org/1220963004/diff/200001/media/blink/buffered_data_source.cc#newcode430 > ...
5 years, 5 months ago (2015-07-13 21:56:21 UTC) #30
hubbe
lgtm
5 years, 5 months ago (2015-07-13 21:58:54 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1220963004/280001
5 years, 5 months ago (2015-07-13 22:39:46 UTC) #34
horo
dalecurtis@ Could you please review this?
5 years, 5 months ago (2015-07-13 22:41:06 UTC) #37
DaleCurtis
lgtm
5 years, 5 months ago (2015-07-14 00:39:49 UTC) #38
horo
On 2015/07/14 00:39:49, DaleCurtis wrote: > lgtm Thank you!
5 years, 5 months ago (2015-07-14 01:59:59 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1220963004/280001
5 years, 5 months ago (2015-07-14 02:00:29 UTC) #41
commit-bot: I haz the power
Committed patchset #5 (id:280001)
5 years, 5 months ago (2015-07-14 02:05:28 UTC) #42
commit-bot: I haz the power
5 years, 5 months ago (2015-07-14 02:06:27 UTC) #43
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/7ab9c6c314f589251c85913bd0a360cba24eb76a
Cr-Commit-Position: refs/heads/master@{#338620}

Powered by Google App Engine
This is Rietveld 408576698