Closed Bug 1754672 Opened 3 years ago Closed 3 years ago

Permanent comm/mail/test/browser/content-policy/browser_jsContentPolicy.js | JS should be turned on in content. - "undefined" == true | noscript display should be 'none' - "inline" == "none"

Categories

(Thunderbird :: Security, defect, P5)

Tracking

(thunderbird_esr91 fixed, thunderbird98 fixed)

RESOLVED FIXED
99 Branch
Tracking Status
thunderbird_esr91 --- fixed
thunderbird98 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: mkmelin)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

It's not failing on debug because the content policy tests don't run on debug.

Summary: Intermittent comm/mail/test/browser/content-policy/browser_jsContentPolicy.js | JS should be turned on in content. - "undefined" == true | noscript display should be 'none' - "inline" == "none" → Permanent comm/mail/test/browser/content-policy/browser_jsContentPolicy.js | JS should be turned on in content. - "undefined" == true | noscript display should be 'none' - "inline" == "none"
See Also: → 1754785

I'm not super familiar with the thunderbird code, so I'll be guessing a bit here. It appears that in bug 1643986 you made thunderbird set sandboxing flags on the BrowsingContext from the nsMsgContentPolicy.cpp code whenever a message is loaded. This will, in turn, cause all loads in that BrowsingContext to be sandboxed. Before the changes I landed last week, we were incorrectly dropping those sandboxing flags after some types of navigations, so it didn't come up in testing that after the flags were set, they were never cleared.

You probably need to make the else branch in that function also configure the sandbox flags on the BrowsingContext to be more relaxed in order to get things working more consistently.

Flags: needinfo?(nika)

I did try rv = browsingContext->SetSandboxFlags(SANDBOXED_NONE); in the else. But the test still fails.

The flags are things to enable, so it should be SANDBOX_ALL_FLAGS, not SANDBOXED_NONE. I think. I'll see what the Try server thinks.

Okay. That didn't work.

Tried also clearing explicitly the SANDBOXED_SCRIPTS, but no changes to the flags take effect.
It's this line causing it - https://hg.mozilla.org/mozilla-central/rev/b3a8f99f0044f5a4c7c44878d67c3de880b68340#l2.15
Would setting the initial sandboxflags (on the next line) be enough?

Before the changes in bug 1754785, sandboxing flags were dropped after some types of navigations => we started off from unsandboxed here.
This patch sets that unsandboxed state explicitely on the browsing context so when the code bails out early (for data: url) the we do not get the sandboxing of what used to be loaded in the context.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/e9cce01454a0
fix browser_jsContentPolicy.js after bug 1754785. r=benc

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch

Comment on attachment 9263732 [details]
Bug 1754672 - fix browser_jsContentPolicy.js after bug 1754785. r=benc

[Triage Comment]
Fix for browser_jsContentPolicy.js failures caused by uplift of bug 1744352 to m-beta. Not sure why bug 1754785 is mentioned; it doesn't seem to affect the outcome of the tests.

Attachment #9263732 - Flags: approval-comm-beta+

The commit comment should have said "after bug 1744352".
Bug 1754785 is also caused by that bug.

Comment on attachment 9263732 [details]
Bug 1754672 - fix browser_jsContentPolicy.js after bug 1754785. r=benc

[Approval Request Comment]
Per comment 16, bug 1744352 caused this bug. Bug 1744352 was uplifted to m-esr91 necessitating uplift.

Attachment #9263732 - Flags: approval-comm-esr91?

Comment on attachment 9263732 [details]
Bug 1754672 - fix browser_jsContentPolicy.js after bug 1754785. r=benc

[Triage Comment]
approved for esr91

Attachment #9263732 - Flags: approval-comm-esr91? → approval-comm-esr91+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: