Closed
Bug 1264571
Opened 9 years ago
Closed 9 years ago
Add a test case of isolating Broadcast Channels for first party. (Tor 16300)
Categories
(Core :: DOM: Security, defect, P1)
Core
DOM: Security
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: timhuang, Assigned: timhuang)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [tor-testing][domsecurity-active][ETA 10/10])
Attachments
(1 file, 2 obsolete files)
We should have a test case for isolation of Broadcast Channels to first party. https://torpat.ch/16300
Updated•9 years ago
|
Whiteboard: [tor], [OA] → [tor], [OA][domsecurity-backlog]
Updated•9 years ago
|
Summary: Isolate Broadcast Channels to first party. (Tor Bug#16300) → Isolate Broadcast Channels to first party. (Tor 16300)
Whiteboard: [tor], [OA][domsecurity-backlog] → [tor][OA-testing][domsecurity-backlog]
Updated•9 years ago
|
Whiteboard: [tor][OA-testing][domsecurity-backlog] → [tor][OA][domsecurity-backlog]
Comment 1•9 years ago
|
||
Please note the WIP attachment is out of date, and the current Tor Browser patch is at
https://torpat.ch/16300
Comment 2•9 years ago
|
||
Is this a testing bug or implementation bug?
Updated•9 years ago
|
Priority: -- → P1
Comment 3•9 years ago
|
||
Broadcast channel is already separated by origin attributes. Here's the test:
http://searchfox.org/mozilla-central/source/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js
This bug should be resolved as soon as first-party URI is in the origin attributes, but we can extend the test for first-party isolation.
Depends on: 1260931
Updated•9 years ago
|
Whiteboard: [tor][OA][domsecurity-backlog] → [tor][domsecurity-backlog]
Updated•9 years ago
|
Priority: P1 → P3
Whiteboard: [tor][domsecurity-backlog] → [tor][domsecurity-backlog1]
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → tihuang
Status: NEW → ASSIGNED
Priority: P3 → P1
Whiteboard: [tor][domsecurity-backlog1] → [tor][domsecurity-active]
Assignee | ||
Updated•9 years ago
|
Summary: Isolate Broadcast Channels to first party. (Tor 16300) → Add a test case of isolating Broadcast Channels for first party. (Tor 16300)
Whiteboard: [tor][domsecurity-active] → [tor-testing][domsecurity-active]
Whiteboard: [tor-testing][domsecurity-active] → [tor-testing][domsecurity-active][ETA 10/10]
Updated•9 years ago
|
Priority: P1 → P2
Updated•9 years ago
|
Blocks: FirstPartyIsolation
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8797397 -
Flags: review?(arthuredelstein)
Attachment #8797397 -
Flags: review?(amarchesini)
Comment 5•9 years ago
|
||
Comment on attachment 8797397 [details] [diff] [review]
Add a test case of isolating broadcast channels for first party isolation.
Review of attachment 8797397 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/components/originattributes/test/browser/browser_broadcastChannel.js
@@ +21,5 @@
> + return data;
> + }
> +
> + return displayItem.innerHTML;
> + });
This doesn't work because we are isolating, but because broadcastChannel is async. You should give time to retrieve the data.
And this is racy, right?
Attachment #8797397 -
Flags: review?(amarchesini)
Assignee | ||
Comment 6•9 years ago
|
||
Just make clear that I understand this correctly, are you saying that this is working is not because the broadcast channel is isolated, but because the broadcast channel is async.
Comment 7•9 years ago
|
||
Correct.
Comment 8•9 years ago
|
||
Comment on attachment 8797397 [details] [diff] [review]
Add a test case of isolating broadcast channels for first party isolation.
Review of attachment 8797397 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/components/originattributes/test/browser/browser_broadcastChannel.js
@@ +4,5 @@
> +
> +const TEST_DOMAIN = "http://example.net/";
> +const TEST_PATH = TEST_DOMAIN + "browser/browser/components/originattributes/test/browser/";
> +const TEST_PAGE = TEST_PATH + "file_broadcastChannel.html";
> +
// Maybe here you could define something like.
let waitForBroadcastMessage = function (broadcastChannel) {
return new Promise(resolve => {
broadCastChannel.onmessage = e => resolve(e);
});
};
@@ +16,5 @@
> + // which was received from the broadcast channel.
> + if (displayItem.innerHTML.length === 0) {
> + let data = Math.random().toString();
> + let bc = new content.BroadcastChannel("testBroadcastChannel");
> + bc.postMessage(data);
// Then here you could do
let messagePromise = waitForBroadcastMessage(bc);
bc.postMessage(data);
yield messagePromise;
// Probably this ensures that the message has been properly broadcast before
// you return from doTest?
Updated•9 years ago
|
Attachment #8797397 -
Flags: review?(arthuredelstein)
Assignee | ||
Updated•9 years ago
|
Attachment #8797397 -
Attachment is obsolete: true
Comment hidden (mozreview-request) |
Comment 10•9 years ago
|
||
mozreview-review |
Comment on attachment 8798012 [details]
Bug 1264571 - Add a test case of isolating broadcast channels for first party isolation.
https://reviewboard.mozilla.org/r/83616/#review82250
Looks good to me. Thanks, Tim!
Attachment #8798012 -
Flags: review?(arthuredelstein) → review+
Assignee | ||
Updated•9 years ago
|
Priority: P2 → P1
Comment 11•9 years ago
|
||
mozreview-review |
Comment on attachment 8798012 [details]
Bug 1264571 - Add a test case of isolating broadcast channels for first party isolation.
https://reviewboard.mozilla.org/r/83616/#review87578
::: browser/components/originattributes/test/browser/browser_broadcastChannel.js:21
(Diff revision 1)
> + // The way that how we make sure the message is delivered is based on an
> + // iframe which will reply everything it receives from the broadcast channel
> + // to the current window through the postMessage. So, we can know that the
> + // boradcast message is sent successfully when the window receives a message
> + // from the iframe.
> + if (displayItem.innerHTML.length === 0) {
displayItem.innerHTML == ""
::: browser/components/originattributes/test/browser/browser_broadcastChannel.js:26
(Diff revision 1)
> + if (displayItem.innerHTML.length === 0) {
> + let data = Math.random().toString();
> +
> + let receivedData = yield new Promise(resolve => {
> + let listenFunc = event => {
> + content.removeEventListener("message", listenFunc, false);
remove "false". It's optional.
Attachment #8798012 -
Flags: review?(amarchesini) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Updated•9 years ago
|
Attachment #8741280 -
Attachment is obsolete: true
Comment 14•9 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/48aec91f819f
Add a test case of isolating broadcast channels for first party isolation. r=arthuredelstein,baku
Keywords: checkin-needed
Comment 15•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment 16•5 years ago
|
||
Công ty phế liệu giá cao Việt Đức đã xem và thấy rất tốt! <a href=" https://phelieuvietduc.com/" rel="nofolow"> https://phelieuvietduc.com/ </a>
You need to log in
before you can comment on or make changes to this bug.
Description
•