Firefox · DOM
CVE-2026-12302
Logic Error in DOM
Overview
Medium
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Files Changed
dom/workers/sharedworkers/SharedWorker.cpp
Patch
diff --git a/dom/workers/sharedworkers/SharedWorker.cpp b/dom/workers/sharedworkers/SharedWorker.cpp
index 7593414e2ad..a74d9258b77 100644
--- a/dom/workers/sharedworkers/SharedWorker.cpp
+++ b/dom/workers/sharedworkers/SharedWorker.cpp
@@ -82,6 +82,12 @@ already_AddRefed<SharedWorker> SharedWorker::Constructor(
do_QueryInterface(aGlobal.GetAsSupports());
MOZ_ASSERT(window);
+ if (!window->IsCurrentInnerWindow()) {
+ aRv.ThrowInvalidStateError(
+ "Cannot create worker for a going to be discarded document");
+ return nullptr;
+ }
+
// Our current idiom is that storage-related APIs specialize for the system
// principal themselves, which is consistent with StorageAllowedForwindow not
// specializing for the system principal. Without this specialization we
Loading diff…
References
On This Page