Closed Bug 1777295 Opened 2 years ago Closed 2 years ago

document.requestStorageAccess error thrown even from static (plaintext) iframe content

Categories

(Core :: Privacy: Anti-Tracking, defect, P2)

Firefox 102
defect

Tracking

()

VERIFIED FIXED
104 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- wontfix
firefox102 --- wontfix
firefox103 --- wontfix
firefox104 --- verified

People

(Reporter: myf, Assigned: bvandersloot)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Interacting with any(?) iframe content produces

document.requestStorageAccess() may not be called on a document with an opaque origin, such as a sandboxed iframe without allow-same-origin in its sandbox attribute.

error visible in dev-tools console.

Test:

data:text/html,<!doctype html><iframe src="data:text/plain,interact here"></iframe>

Click fires this exception twice, non-modifier key press once. As seen, there is no JavaScript requesting anything involved. Same outcome when loaded as real file from secure origin.

Observed in current newest stable v102, Developer Edition (v103.0b2 20220628190840) and v104 Nightly. Not reproducible in last v101.

The severity field is not set for this bug.
:dveditz, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dveditz)
Component: Security → Privacy: Anti-Tracking
Flags: needinfo?(dveditz) → needinfo?(tihuang)

mozregression points to Bug 1765309. Ben, could you please take a look? Thanks!

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(tihuang) → needinfo?(bvandersloot)
Regressed by: 1765309
Assignee: nobody → bvandersloot
Status: NEW → ASSIGNED

In combining code paths for hasStorageAccess and requestStorageAccess, I incidentally included console logs for hasStorageAccess calls. This was exacerbated by using the hasStorageAccess code paths to check if an iframe should get the storageAccessAPI permission on user interaction. This resulted in the above bug. There is a related but slightly different behavior that is probably also observed by the reporter: the console may have also reported document.requestStorageAccess() may not be called in a sandboxed iframe without allow-storage-access-by-user-activation in its sandbox attribute. Both cases are to be fixed by https://phabricator.services.mozilla.com/D152171

Assignee: bvandersloot → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(bvandersloot)
Keywords: regression
Assignee: nobody → bvandersloot
Keywords: regression
Status: NEW → ASSIGNED
Pushed by bvandersloot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/91af4fe4bfab
document.requestStorageAccess error thrown even from static (plaintext) iframe content, r=pbz

Could you review the severity on this?
Is there any functional regression on this that would need a 103 uplift consideration or could this patch ride the trains with 104?

Flags: needinfo?(tihuang)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

It doesn't really break the functionality of Storage Access API but it causes incorrect console messages. I think we should consider uplifting this bug if possible given that this confuses developers.

Severity: -- → S2
Flags: needinfo?(tihuang)
Priority: -- → P2

The patch landed in nightly and beta is affected.
:bvandersloot, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox103 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(bvandersloot)

Setting 103 to fix-optional. 103 is now in RC.
When you are confident in the fix, if I get a release uplift request I can consider it as a ride-along in an RC respin or dot release for 103.

While requesting an uplift I went to verify this patch works in Nightly. When testing I found that there are tab crashes with iframes in today's Nightly release. I'm going to try to see if this patch is causing those crashes or if it is unrelated.

Leaving the needinfo.

I don't think this needs to be in 103. Seems to risky to do an uplift at this point. The issue exists since 102 already and is only developer-facing.

If I can speak for developers, I agree there is no need to rush with uplifting. From developer's perspective it is really just a strange message in the console that appears on "gesture". When concerned, searching for it's text should bring them to this issue and dispel their worries.

Crashes were unrelated.

We discussed this and think :pbz is correct. A RC uplift for a developer-facing feature is too high risk.

Marking as wontfix in 103.

Flags: needinfo?(bvandersloot)
Flags: qe-verify+

Reproduced the issue with Firefox 104.0a1 (2022-06-29) on Windows 10x64.
The issue is verified fixed with Firefox 104.0b4 (20220731190208) on Windows 10x64, macOS 11 and Ubuntu 20. The error is no longer displayed inside the web console after interacting with the field from the comment 0 test case.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

This doesn't graft cleanly to ESR102 and it seems edge case enough that we can probably live with this bug there. If you strongly disagree, feel free to attach a rebased patch and request uplift approval.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: