Closed Bug 1887029 Opened 11 months ago Closed 10 months ago

Restrict tab attributes TabAttributes can restore

Categories

(Firefox :: Session Restore, task)

task

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox-esr115 126+ fixed
firefox124 --- wontfix
firefox125 --- wontfix
firefox126 + fixed

People

(Reporter: nika, Assigned: nika)

References

Details

(Keywords: sec-want, Whiteboard: [adv-main126-] [adv-ESR115.11-])

Attachments

(2 files)

The TabAttributes code in SessionStore is currently designed to be able to save & restore arbitrary attributes on tabs in the browser, however it is only ever used to restore a single attribute ("customizemode") outside of tests. We should simplify this code and only allow it to save & restore supported attributes.

The only tab attribute which is ever persisted by SessionStore is
"customizemode". This patch limits the logic to only allow persisting and
restoring this attribute.

The browser_attributes.js test is also updated to use the "customizemode"
attribute for testing, rather than a custom specified attribute.

Depends on D205480

Adding the other peers to cc so we can discuss this patch.

Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/07f554ea4869 Simplify TabAttributes to explicitly specify supported attributes, r=sessionstore-reviewers,sfoster,dao
Backout by abutkovits@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8daf286173c4 Backed out 3 changesets (bug 1887029, bug 1886892) for causing failures at browser_all_files_referenced.js. CLOSED TREE
Flags: needinfo?(nika)

Backed out (bug 1887029, bug 1886892) for causing failures at browser_all_files_referenced.js:
https://hg.mozilla.org/integration/autoland/rev/8daf286173c44985a773a83871e29d29f8e08cd8

Push with failures
Failure log

browser/base/content/test/static/browser_all_files_referenced.js | unreferenced file: resource://gre/modules/sessionstore/Utils.sys.mjs

Flags: needinfo?(nika)
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e8ff1a8679fb Simplify TabAttributes to explicitly specify supported attributes, r=sessionstore-reviewers,sfoster,dao
Group: firefox-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
QA Whiteboard: [post-critsmash-triage]
Flags: qe-verify-

:nika this grafts cleanly to esr115.
Could you please add an esr115 uplift request?

Flags: needinfo?(nika)

Comment on attachment 9392813 [details]
Bug 1887029 - Simplify TabAttributes to explicitly specify supported attributes, r=#sessionstore-reviewers!

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Browser security improvements
  • User impact if declined: Higher potential for TabAttributes code abuse in ESR
  • Fix Landed on Version: 126
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Changes to sessionstore code are always somewhat risky, but this is a well scoped change to reduce the functionality of a previously-exploited component to only the features actually used by the browser.
Flags: needinfo?(nika)
Attachment #9392813 - Flags: approval-mozilla-esr115?

Comment on attachment 9392813 [details]
Bug 1887029 - Simplify TabAttributes to explicitly specify supported attributes, r=#sessionstore-reviewers!

Approved for 115.11esr.

Attachment #9392813 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+

It looks like createAboutBlankDocumentViewer (from browser_attributes.js) is called createAboutBlankContentViewer on esr115. I'm not sure if there are other issues.

I'll check locally if that's sufficient to fix the test, as Nika is out.

The only tab attribute which is ever persisted by SessionStore is
"customizemode". This patch limits the logic to only allow persisting and
restoring this attribute.

The browser_attributes.js test is also updated to use the "customizemode"
attribute for testing, rather than a custom specified attribute.

Minor test fix for ESR115.

I confirmed with a try push that browser_attributes.js passes with the new version of the patch. I just replaced one instance of createAboutBlankDocumentViewer with createAboutBlankContentViewer in the test.

Flags: needinfo?(nika)

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

This is ready to reland on esr115 with the new version of the patch I attached ( https://phabricator.services.mozilla.com/D208655 ). Thanks.

Flags: needinfo?(dmeehan)
Flags: needinfo?(dmeehan)
Whiteboard: [adv-main126-] [adv-ESR115.11-]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: