Moderate firefox Logic Error 🔧 Commit mapped

Overview

Moderate
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Impactmoderate
DescriptionMitigation bypass in the DOM: Service Workers component
ComponentCore
Bug ClassLogic Error
Tracker2063488
Fix commit4104747738ba (firefox) +8/-4
CISA KEVNot listed
CreditedWinD39
Disclosed2026-09-29

Files Changed

  • docshell/base/BrowsingContext.cpp
  • docshell/base/BrowsingContext.h
diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp
index a42152a8696..e515fdd9d2e 100644
--- a/docshell/base/BrowsingContext.cpp
+++ b/docshell/base/BrowsingContext.cpp
@@ -895,6 +895,10 @@ const char* BrowsingContext::BrowsingContextCoherencyChecks(
     return "Content cannot create chrome BCs";
   }
 
+  if (aOriginProcess && GetServiceWorkersTestingEnabled()) {
+    return "Content cannot enable ServiceWorkersTestingEnabled";
+  }
+
   // LoadContext should generally match our opener or parent.
   if (IsContent()) {
     if (RefPtr<BrowsingContext> opener = GetOpener()) {
diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h
index bc790db9f60..e910da61612 100644
--- a/docshell/base/BrowsingContext.h
+++ b/docshell/base/BrowsingContext.h
@@ -1309,13 +1309,13 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
               nsILoadInfo::CrossOriginOpenerPolicy, ContentParent*);
 
   bool CanSet(FieldIndex<IDX_ServiceWorkersTestingEnabled>, bool,
-              ContentParent*) {
-    return IsTop();
+              ContentParent* aSource) {
+    return XRE_IsParentProcess() && !aSource && IsTop();
   }
 
   bool CanSet(FieldIndex<IDX_ServiceWorkersDisabledByPolicy>, bool,
-              ContentParent*) {
-    return IsTop();
+              ContentParent* aSource) {
+    return XRE_IsParentProcess() && !aSource && IsTop();
   }
 
   bool CanSet(FieldIndex<IDX_LanguageOverride>, const nsCString&,
Loading diff…