Closed
Bug 1986632
Opened 5 months ago
Closed 4 months ago
Trusted Types policies should not apply to isolated WebExtension content scripts - part 2
Categories
(Core :: DOM: Security, task)
Core
DOM: Security
Tracking
()
RESOLVED
FIXED
145 Branch
| Tracking | Status | |
|---|---|---|
| firefox145 | --- | fixed |
People
(Reporter: fredw, Assigned: fredw)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
Attachments
(2 files, 1 obsolete file)
We make some effort to exempt extensions from page CSPs (bug 1267027), we should consider doing the same for Trusted Types, otherwise pages could unduly restrict the functionality of extensions.
This is a follow-up of bug 1947732, it seems some cases where we still pass a null principal to GetTrustedTypesCompliantString:
find dom -type f | xargs grep -A3 GetTrustedTypesCompliantString | grep -B3 nullptr
dom/security/trusted-types/TrustedTypeUtils.cpp- const nsINode& aNode,
--
dom/security/trusted-types/TrustedTypeUtils.cpp: return GetTrustedTypesCompliantString<TrustedHTML>(
dom/security/trusted-types/TrustedTypeUtils.cpp- &aInput, aSink, aSinkGroup, aNode, nullptr, aResultHolder, aError);
--
dom/security/trusted-types/TrustedTypeUtils.cpp- const nsAString& aSinkGroup, nsIGlobalObject& aGlobalObject,
dom/security/trusted-types/TrustedTypeUtils.cpp- Maybe<nsAutoString>& aResultHolder, ErrorResult& aError) {
dom/security/trusted-types/TrustedTypeUtils.cpp: return GetTrustedTypesCompliantString<TrustedScript>(
dom/security/trusted-types/TrustedTypeUtils.cpp- &aInput, aSink, aSinkGroup, aGlobalObject, nullptr, aResultHolder,
--
dom/security/trusted-types/TrustedTypeUtils.cpp- const nsAString& aSinkGroup, const nsINode& aNode,
dom/security/trusted-types/TrustedTypeUtils.cpp- Maybe<nsAutoString>& aResultHolder, ErrorResult& aError) {
dom/security/trusted-types/TrustedTypeUtils.cpp: return GetTrustedTypesCompliantString<TrustedScript>(
dom/security/trusted-types/TrustedTypeUtils.cpp- &aInput, aSink, aSinkGroup, aNode, nullptr, aResultHolder, aError);
--
--
dom/workers/WorkerScope.cpp: TrustedTypeUtils::GetTrustedTypesCompliantString(
dom/workers/WorkerScope.cpp- scriptURL, sink, kTrustedTypesOnlySinkGroup, *pinnedGlobal,
dom/workers/WorkerScope.cpp- nullptr, compliantStringHolder, aRv);
So they are:
- importScript: https://searchfox.org/firefox-main/rev/8a50d94240fb8f312d8b061a425ff0755bcbaac4/dom/workers/WorkerScope.cpp#674
- write/writeln: https://searchfox.org/firefox-main/rev/e02959386f6f89c1476edba10b3902f4e4f3ed4c/dom/security/trusted-types/TrustedTypeUtils.cpp#598
- eval/new Function: https://searchfox.org/firefox-main/rev/e02959386f6f89c1476edba10b3902f4e4f3ed4c/dom/security/trusted-types/TrustedTypeUtils.cpp#598
- script enforcement (https://phabricator.services.mozilla.com/D246745)
| Comment hidden (obsolete) |
| Assignee | ||
Comment 2•4 months ago
|
||
This is a follow-up of bug 1947732, covering the remaining Trusted Types checks:
- Document.write/writeln
- WorkerGlobalScope.importScripts
- eval and new Functions
- script enforcement
- pre-navigation check
Updated•4 months ago
|
Assignee: nobody → fwang
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•4 months ago
|
||
| Assignee | ||
Comment 4•4 months ago
|
||
Updated•4 months ago
|
Attachment #9511948 -
Attachment description: WIP: Bug 1986632 - Add tests for pre-navigation check → WIP: Bug 1986632 - More tests to test_ext_contentscript_trustedtypes.js
Updated•4 months ago
|
Attachment #9511342 -
Attachment description: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers! → WIP: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers!
Updated•4 months ago
|
Attachment #9511342 -
Attachment description: WIP: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers! → Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers!
Updated•4 months ago
|
Attachment #9511342 -
Attachment description: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers! → WIP: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers!
Updated•4 months ago
|
Attachment #9511342 -
Attachment description: WIP: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers! → Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers!
Updated•4 months ago
|
Attachment #9511948 -
Attachment is obsolete: true
Updated•4 months ago
|
Attachment #9511342 -
Attachment description: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers! → WIP: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers!
Updated•4 months ago
|
Attachment #9511342 -
Attachment description: WIP: Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers! → Bug 1986632 - Exempt (isolated) WebExtension content scripts from trusted types policies. r?smaug!,#extension-reviewers!
| Assignee | ||
Comment 5•4 months ago
|
||
Pushed by fwang@igalia.com:
https://github.com/mozilla-firefox/firefox/commit/9a0ef0f5ea5e
https://hg.mozilla.org/integration/autoland/rev/80785b6e96ad
Exempt (isolated) WebExtension content scripts from trusted types policies. r=smaug,webidl,robwu,dom-worker-reviewers,asuth
Comment 7•4 months ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
status-firefox145:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 145 Branch
Updated•3 months ago
|
QA Whiteboard: [qa-triage-done-c146/b145]
You need to log in
before you can comment on or make changes to this bug.
Description
•