Closed Bug 1634734 Opened 5 years ago Closed 4 years ago

Session store can't restore session-only storage correctly.

Categories

(Firefox :: Session Restore, defect, P2)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1710004
Tracking Status
firefox78 --- fix-optional

People

(Reporter: xeonchen, Assigned: farre)

References

Details

In [1] it passes nullptr to create session storage, which was retrieved in [2].
More precisely, it can't restore windows which have session-only storage [3].

If you duplicate tab A to tab B, where A doesn't have storage access (or is being partitioned), then the session-only session storage in A will be restored to B as non-session-only session storage, and that can't be accessed by the web content.

[1] https://searchfox.org/mozilla-central/rev/7fd1c1c34923ece7ad8c822bee062dd0491d64dc/toolkit/components/sessionstore/SessionStoreUtils.cpp#1232
[2] https://searchfox.org/mozilla-central/rev/7fd1c1c34923ece7ad8c822bee062dd0491d64dc/toolkit/components/sessionstore/SessionStoreUtils.cpp#1119
[3] https://searchfox.org/mozilla-central/rev/7fd1c1c34923ece7ad8c822bee062dd0491d64dc/dom/storage/Storage.cpp#46

See Also: → 1634304
Flags: needinfo?(alchen)
Severity: -- → normal
Priority: -- → P2

I've discussed this bug with Gary.

Summarize what I know:

[First of all]
This is not a regression. It is a feature that we don't have in the current 'sessionRestore' implementation.

[Current Situation]
'sessionRestore' doesn't care about StorageAccess when doing collect() from current sessionStorage.
Then 'sessionRestore' cannot set the same StorageAccess of sessionStorage as what we suppose to restore.
When enabling Dynamic First-Party Isolation(Bug 1628486), we will meet the storage access problem in some situations (as comment 1).

[How to correct the behavior]
When doing storage.collect() from sessionStorage, 'session restore' need to collect the storageAccess as well. If we know the storageAccess, we can set the right storageAccess when creating sessionStorage in storage.restore().

Flags: needinfo?(alchen)

Besides the correctness of mIsSessionOnly, my another concern would be the client code of Storage::GetParentObject, but I haven't found any tests related to it.

Severity: normal → S3

Quote the offline chat with Ethan, who is managing the Dynamic FPI project -
"Regarding bug 1634734, the problem only affects session cookies of 3rd-party non-tracker iframes during session restore, which is quite an edge case. I would say it's not urgent at all. maybe severity could be S4."

This is going to get fixed (as a side-effect) by fixing bug 1710004.

Assignee: nobody → afarre
Status: NEW → ASSIGNED
Depends on: 1710004
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.