gecko-dev/dom/security
Nika Layzell 1eb3c1d7cd Bug 1906734 - Switch WebExtension resources to use only static protocol flags, r=extension-reviewers,necko-reviewers,kershaw,robwu
Previously, the WebExtension protocol used dynamic protocol flags which
were based on the WebExtension policy in order to enforce things such as
availability in private browsing and the accessibility of certain
resources.

Since the shift to MV3, these checks have required more complex checks
than what was possible to specify with protocol flags, which required
the addition of WEBEXT_URI_WEB_ACCESSIBLE - a security flag which would
trigger further checks with the EPS to determine if the URI can be
loaded.

This was somewhat inefficient, as fetching the URI flags would require
looking up the policy each time dynamic flags were looked up, as well as
when policy specifics were being checked after loading flags. In
addition, it lead to a number of flags which were very specific to
extension protocols.

This patch changes extensions to no longer have dynamic flags, instead
specifying the static `URI_IS_WEBEXTENSION_RESOURCE` security flag. When
this flag is specified, security checks are made by querying the
ExtensionPolicyService to ask if the load should be permitted, combining
the specific security checks for Extension resources into a simpler
code-path, and avoids redundant checks.

Differential Revision: https://phabricator.services.mozilla.com/D216076
2024-07-17 16:02:34 +00:00
..
featurepolicy Bug 1755081 - Add tests for more containers. r=smaug 2024-06-26 07:46:16 +00:00
fuzztest
sanitizer
test Bug 1907590: Improve labels for https telemetry, r=freddyb,kershaw,necko-reviewers,maltejur 2024-07-17 15:29:24 +00:00
trusted-types Bug 1901510: part 4) Implement reporting CSP violations for the "trusted-types" directive for Windows (not Workers). r=tschuster 2024-07-03 12:10:44 +00:00
CSPEvalChecker.cpp Bug 1894231 - P3 Remove WorkerPrivate* in WorkerMainThreadRunnable. r=dom-worker-reviewers,extension-reviewers,smaug,rpl 2024-06-24 22:20:51 +00:00
CSPEvalChecker.h
CSPViolationData.cpp Bug 1896344: part 7) Move effective directive to `CSPViolationData`. r=tschuster 2024-06-17 08:21:11 +00:00
CSPViolationData.h Bug 1901510: part 4) Implement reporting CSP violations for the "trusted-types" directive for Windows (not Workers). r=tschuster 2024-07-03 12:10:44 +00:00
DOMSecurityMonitor.cpp
DOMSecurityMonitor.h
DomSecurityIPCUtils.h Bug 1907590: Improve labels for https telemetry, r=freddyb,kershaw,necko-reviewers,maltejur 2024-07-17 15:29:24 +00:00
FramingChecker.cpp
FramingChecker.h
PolicyTokenizer.cpp
PolicyTokenizer.h
ReferrerInfo.cpp Bug 1904004 - Use OriginAttributes::IsPrivateBrowsing instead of open coding PBM checks. r=timhuang,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,necko-reviewers,kershaw,dom-storage-reviewers,janv,canaltinova,dom-worker-reviewers,asuth 2024-06-24 11:06:18 +00:00
ReferrerInfo.h
SRICheck.cpp
SRICheck.h
SRILogHelper.h
SRIMetadata.cpp
SRIMetadata.h
SecFetch.cpp Bug 697151 - distinguish between SYNC and ASYNC XMLHttpRequests in nsIContentPolicy types, and have ChannelEventQueue::MaybeSuspendIfEventsAreSuppressed only suspend async ones; r=nika,necko-reviewers,peterv,dom-storage-reviewers,asuth,kershaw 2024-06-24 18:45:18 +00:00
SecFetch.h
metrics.yaml
moz.build Bug 1883954: Update, improve and unify HTTPS Telemetry, r=freddyb,kershaw,necko-reviewers 2024-06-24 12:56:31 +00:00
nsCSPContext.cpp Bug 1901510: part 4) Implement reporting CSP violations for the "trusted-types" directive for Windows (not Workers). r=tschuster 2024-07-03 12:10:44 +00:00
nsCSPContext.h Bug 1901510: part 4) Implement reporting CSP violations for the "trusted-types" directive for Windows (not Workers). r=tschuster 2024-07-03 12:10:44 +00:00
nsCSPParser.cpp Bug 1901491: part 3) Implement `ShouldTrustedTypePolicyCreationBeBlockedByCSP` for Windows (not Workers) including reporting exceptions, excluding reporting violations. r=tschuster,webidl,saschanaz 2024-06-20 07:57:31 +00:00
nsCSPParser.h Bug 1901491: part 3) Implement `ShouldTrustedTypePolicyCreationBeBlockedByCSP` for Windows (not Workers) including reporting exceptions, excluding reporting violations. r=tschuster,webidl,saschanaz 2024-06-20 07:57:31 +00:00
nsCSPService.cpp
nsCSPService.h
nsCSPUtils.cpp Bug 1901510: part 3) Factor logging violation details after the violation-check out of `nsCSPContext::LogViolationDetails`. r=tschuster 2024-07-02 08:21:20 +00:00
nsCSPUtils.h Bug 1901510: part 4) Implement reporting CSP violations for the "trusted-types" directive for Windows (not Workers). r=tschuster 2024-07-03 12:10:44 +00:00
nsContentSecurityManager.cpp Bug 1906734 - Switch WebExtension resources to use only static protocol flags, r=extension-reviewers,necko-reviewers,kershaw,robwu 2024-07-17 16:02:34 +00:00
nsContentSecurityManager.h
nsContentSecurityUtils.cpp Bug 1904004 - Use OriginAttributes::IsPrivateBrowsing instead of open coding PBM checks. r=timhuang,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,necko-reviewers,kershaw,dom-storage-reviewers,janv,canaltinova,dom-worker-reviewers,asuth 2024-06-24 11:06:18 +00:00
nsContentSecurityUtils.h
nsHTTPSOnlyStreamListener.cpp
nsHTTPSOnlyStreamListener.h
nsHTTPSOnlyUtils.cpp Bug 1907590: Improve labels for https telemetry, r=freddyb,kershaw,necko-reviewers,maltejur 2024-07-17 15:29:24 +00:00
nsHTTPSOnlyUtils.h Bug 1896083 - Do not HTTPS-First upgrade hostnames that do not end with a known public suffix r=necko-reviewers,valentin,simonf,freddyb 2024-06-21 16:47:41 +00:00
nsIHttpsOnlyModePermission.idl Bug 1886184 - Add HTTPS-Only Permission Types exclusively for HTTPS-First r=freddyb,simonf 2024-05-27 18:57:24 +00:00
nsMixedContentBlocker.cpp Bug 1904004 - Use OriginAttributes::IsPrivateBrowsing instead of open coding PBM checks. r=timhuang,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,necko-reviewers,kershaw,dom-storage-reviewers,janv,canaltinova,dom-worker-reviewers,asuth 2024-06-24 11:06:18 +00:00
nsMixedContentBlocker.h