Open Bug 1917842 Opened 7 months ago Updated 5 months ago

Blob isolation causes downloads to fail from extension pages embedded in partitioned iframes

Categories

(WebExtensions :: General, defect, P3)

Firefox 131
defect

Tracking

(firefox-esr115 unaffected, firefox-esr128 affected, firefox130 wontfix, firefox131 wontfix, firefox132 wontfix, firefox133 wontfix)

Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- affected
firefox130 --- wontfix
firefox131 --- wontfix
firefox132 --- wontfix
firefox133 --- wontfix

People

(Reporter: andrews54757, Unassigned)

References

(Depends on 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Steps to reproduce:

Firefox Developer Edition 131.0 Beta 4 (20240909091655)

  1. Manually install faststream video player extension V1.3.26 from the provided file
  2. Go to https://faststream.online/bugs/firefox-blob-isolation
  3. Click extension icon, the video should be replaced with a custom player.
  4. Click the download icon to save the video to an MP4

Actual results:

File save fails silently

Expected results:

File save should occur

Attachment #9423869 - Attachment is obsolete: true
Attachment #9423869 - Attachment is obsolete: false

Related FastStream issue on Github: https://github.com/Andrews54757/FastStream/issues/235

The Bugbug bot thinks this bug should belong to the 'Firefox::File Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → File Handling

Test page without sandbox set, to demonstrate that it works normally there: https://faststream.online/bugs/firefox-blob-isolation-working

My apologies, it appears like my reproduction methods were incorrect. After some investigation, I discovered that the problem stems from partitioned iframes, not sandboxes. Here are updated instructions for reproducing the issue:

  1. Download firefox-faststream-partition-bug.zip and install as temporary extension in Firefox Developer Edition
  2. Go to https://faststream.online/bugs/firefox-blob-isolation-test
  3. Enable the extension by clicking on the icon
  4. The player should be replaced. Click the download/save icon in the bottom right corner.
  5. The download will fail with the error Cannot access blob URL “blob:moz-extension://...” with a different partition key.

Extension file to use to test

Summary: Blob isolation causes downloads to fail from extension pages embedded in sandboxed iframes → Blob isolation causes downloads to fail from extension pages embedded in partitioned iframes
Attachment #9423869 - Attachment is obsolete: true
Attachment #9423919 - Attachment is obsolete: true
Attachment #9423919 - Attachment is obsolete: false
Attachment #9423873 - Attachment is obsolete: true
Keywords: regression
Regressed by: 1843155

Not sure whether/how add-on APIs are supposed to respond to the partitioning here, but over to webextensions for initial investigation, as this is all before any downloads/file handling code gets its hands on anything.

Component: File Handling → General
Product: Firefox → WebExtensions

:abhishekmadan, since you are the author of the regressor, bug 1843155, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(abhishekmadan2002)

(In reply to :Gijs (he/him) from comment #9)

Not sure whether/how add-on APIs are supposed to respond to the partitioning here

That is yet to be defined. In bug 1698863 I collected some issues around partitioning in the downloads.download API. We probably need some new properties to enable extensions to describe the partition to use. I'll also discuss this with other browser vendors at TPAC 2024 (https://github.com/w3c/webextensions/issues/659#issuecomment-2354057779).

An alternative solution would be for the extension implementation to query for the partition containing the blob:-URL and then issue a download. Since blob:-URLs contain GUIDs, the odds of a conflicting blob:-URL should be negligible. If this is feasibly implementable, then I'd favor such an approach instead of waiting for additions to extension APIs.

Status: UNCONFIRMED → NEW
Depends on: 1698863
Ever confirmed: true

Set release status flags based on info from the regressing bug 1843155

Hi Tim, thought I was would forward this to you. If there is something that I need to contribute for this, I can do that too

Flags: needinfo?(abhishekmadan2002) → needinfo?(tihuang)

Thanks. Let's keep an eye on the TPAC discussion to decide how we proceed.

Flags: needinfo?(tihuang)

(needinfo'ing myself to update this bug when there is a reply)

Tim - is it feasible to look up from any partition as I described in comment 11?

Flags: needinfo?(rob)

Set release status flags based on info from the regressing bug 1843155

We didn't get to discussing this topic at TPAC.

Tim: question, how feasible is the fix I sketched in comment 11?

(In reply to Rob Wu [:robwu] from comment #11)

An alternative solution would be for the extension implementation to query for the partition containing the blob:-URL and then issue a download. Since blob:-URLs contain GUIDs, the odds of a conflicting blob:-URL should be negligible. If this is feasibly implementable, then I'd favor such an approach instead of waiting for additions to extension APIs.

Severity: -- → S3
Flags: needinfo?(rob) → needinfo?(tihuang)
Priority: -- → P3

Sorry for the late response.

I think this is a feasible implementation. The document's partitionKey can be queried through the cookieJarSettings. And the cookieJarSettings is avaiable through the chrome-only interface in the document.webidl.

Flags: needinfo?(tihuang)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: