Closed Bug 2045635 Opened 5 months ago Closed 4 months ago

Validate more fields around docshell load state

Categories

(Core :: IPC, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox-esr140 155+ fixed
firefox-esr153 154+ fixed
firefox152 --- wontfix
firefox153 --- wontfix
firefox154 + fixed

People

(Reporter: vhilla, Assigned: vhilla)

References

Details

Attachments

(3 external files, 1 obsolete file)

To follow-up on bug 2027207 validating principals, we can also add checks to load state.

Assignee: nobody → vhilla
Status: NEW → ASSIGNED
Blocks: 2035756
See Also: → 2027207
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/08c4c75efd4b https://hg.mozilla.org/integration/autoland/rev/65c5f5a151c2 Revert "Bug 2045635 - Validate more fields for nsDocShellLoadState. r=nika" for causing failures at browser_open_docgroup.js.

Looking at my try history, the tests passed previously which is confusing. What's failing is the check for mPartitionedPrincipalToInherit. I remember I had the same happen locally once but wasn't able to reproduce it consistently.

 0:03.55 GECKO(39037) [MozDbg] [./../../../docshell/base/nsDocShellLoadState.cpp:193] mPartitionedPrincipalToInherit = nsIPrincipal { http://example.com^partitionKey=%28http%2Cexample.com%29 } @ 0x7a379b707dc0
 0:03.56 GECKO(39037) [MozDbg] [./../../../docshell/base/nsDocShellLoadState.cpp:194] GetEffectiveTriggeringRemoteType() = "webIsolated=https://example.com"
 0:03.56 GECKO(39037) [MozDbg] [./../../../docshell/base/nsDocShellLoadState.cpp:195] mPrincipalToInherit = nsIPrincipal { moz-nullprincipal:{041f6b76-256e-4969-b90a-576a1c9307f7}?http://example.com } @ 0x7a379c5f6300

Note PPTI is http while remote type is https. That seems like a bug, I'll try to figure out how the principals get out of sync. It gets fixed when changing example.com to https. Reminds me of bug 2003449.

Flags: needinfo?(vhilla)
See Also: → 2047094
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
Regressions: 2048851
Attachment #9609438 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Add more principal validation in 153.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: medium
  • Explanation of risk level: This adds some checks around loading and more edge cases like bug 2048851 might show up. The change has been in Nightly for a month, edge cases would likely be low severity.
  • String changes made/needed?: No
  • Is Android affected?: yes
See Also: → 2054785
Attachment #9609438 - Flags: approval-mozilla-beta? → approval-mozilla-release?
Attachment #9609438 - Attachment is obsolete: true
Attachment #9609438 - Flags: approval-mozilla-release?
Attachment #9619672 - Flags: approval-mozilla-esr153?

firefox-esr153 Uplift Approval Request

  • User impact if declined/Reason for urgency: Add more principal validation in 153.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing: (enhancement)
  • Risk associated with taking this patch: low
  • Explanation of risk level: This adds some checks around loading that could cause crashes. But the change has been in Nightly for a month.
  • String changes made/needed?: no
  • Is Android affected?: yes
Attachment #9619674 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined/Reason for urgency: Add more principal validation in 140.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing: (enhancement)
  • Risk associated with taking this patch: low
  • Explanation of risk level: This adds some checks around loading that could cause crashes. But the change has been in Nightly for a month.
  • String changes made/needed?: No
  • Is Android affected?: yes

:vhilla do we have to uplift the regression(bug 2048851) to esr153 as well?

Flags: needinfo?(vhilla)
Attachment #9619674 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+

No, but thanks for checking. Bug 2048851 wasn't correct and I fixed that in bug 2054487, which was uplifted to esr153.

https://searchfox.org/firefox-esr153/rev/1bc46ce00a05d72817996890aac62c349814d168/docshell/base/nsDocShell.cpp#4308-4311

Flags: needinfo?(vhilla)

This is being backed out of esr140 for causing reftest failures.

Flags: needinfo?(vhilla)
Attachment #9619672 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+

(In reply to Dianna Smith [:diannaS] from comment #17)

This is being backed out of esr140 for causing reftest failures.

That makes sense for this test. A chrome:// reftest is loaded with system principal in a web remote type and embeds an iframe. So we get a system principal to inherit. I looked around and in 153, bug 2011307 changed it so that chrome:// documents always load in the parent.

I'll see if we can slightly tweak the check.

Flags: needinfo?(vhilla)
Depends on: 2011307
Attachment #9619674 - Flags: approval-mozilla-esr140+ → approval-mozilla-esr140?

:vhilla any update?

Flags: needinfo?(vhilla)

Sorry, I'm unsure what's the process when an uplift got backed out. The patch got r+, do you set approval-mozilla-esr140+ or should I land?

I tried pushing to try but lando says hg error in cmd so I was only able to test locally.

Flags: needinfo?(vhilla) → needinfo?(dsmith)

if you updated the revision i can reland it.
the process is you just let me know the fix is corrected, you will see a new 140+ from me.

Flags: needinfo?(dsmith)
Attachment #9619674 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Attachment #9619674 - Flags: approval-mozilla-esr140+ → approval-mozilla-esr140?
QA Whiteboard: [qa-triage-done-c155/b154]

It's again due to bug 2011307, which removed the failing test. The subtest remote -> chrome via clickLink times out.

I had to git fetch hg::https://hg.mozilla.org/releases/mozilla-esr140 to be able to resolve the hg error in cmd lando errors.

Push to try with a fix looks good: https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=78041

Flags: needinfo?(vhilla)

:diannaS, can you land again? I updated the patch to address the test failure.

Flags: needinfo?(dsmith)

We already built esr140 since we are in RC week. It will get picked up to land next week for the next cycle.

Flags: needinfo?(dsmith)
Attachment #9619674 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
See Also: → CVE-2026-16349
See Also: → 2035756
See Also: → 2054677
See Also: → CVE-2026-74939
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: