Medium firefox Logic Error 🔧 Commit mapped

Overview

Medium
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Impactmoderate
DescriptionPrivilege escalation in the Networking: Cookies component
ComponentDOM
Bug ClassLogic Error
Tracker2022382
Fix commit42be1ff328e7 (firefox) +4/-0
CISA KEVNot listed
CreditedSatoki Tsuji
Disclosed2026-08-18

Background

`RecvSetCookies`
the IPC receive handler in the parent process that services a content process’s request to write cookies.
`CookieServiceParent`
the parent-side cookie service that actually commits cookies to storage on behalf of content processes.
`ContentProcessHasCookie`
a validation predicate that checks whether the requesting content process is legitimately associated with the given base domain and origin attributes.
Origin attributes
the partitioning keys (OriginAttributes) that isolate cookies by container, private-browsing state, and first-party domain.

Root Cause Analysis

The vulnerable path was WindowGlobalParent::RecvSetCookies, which received a base domain, origin attributes, and cookie data over IPC and forwarded them directly to CookieServiceParent::SetCookies without confirming that the sending content process was actually permitted to operate on that base domain and those origin attributes. Because content processes are untrusted and can be compromised, the parent must independently verify that any domain and partition a child asks to modify corresponds to content the child is legitimately hosting; this invariant — never trust a child-supplied aBaseDomain/aOriginAttributes pair — was violated.

The fix inserts a call to cs->ContentProcessHasCookie(aBaseDomain, aOriginAttributes) and returns IPC_FAIL when the process has no legitimate association with that cookie scope. This works because it re-establishes the parent-side authorization check before the cookie write, so a process can only set cookies for scopes it actually holds.

Key insight
The single core mistake was a missing parent-side authorization check: RecvSetCookies trusted the content process’s claimed base domain and origin attributes instead of validating them. The fix addresses it by gating the write on ContentProcessHasCookie, rejecting requests for cookie scopes the process is not entitled to.

Attack Path

  1. Compromise a content process An attacker gains code execution in a sandboxed content process, for example via an unrelated renderer bug.
  2. Forge a set-cookie IPC message The attacker sends a RecvSetCookies request supplying an aBaseDomain and aOriginAttributes for a site the process does not legitimately host.
  3. Bypass the absent check Before the fix, the parent forwards the forged request straight to CookieServiceParent::SetCookies with no verification.
  4. Write cross-origin cookies The parent commits cookies for the victim domain or a different partition, escalating the content process’s privilege over cookie state it should not control.

Impact Assessment

An attacker who already controls a content process gains the ability to set cookies for base domains and origin partitions outside that process’s legitimate scope, a privilege escalation within the parent (broker) process’s cookie service. This can be leveraged for session fixation or cross-site state manipulation against other origins. The precondition is a pre-existing compromise or memory-corruption foothold in a content process capable of sending IPC.

Files Changed

  • dom/ipc/WindowGlobalParent.cpp

Audit Directions

  • Unvalidated IPC domain/origin arguments
    Audit every parent-side Recv* handler that accepts a child-supplied domain, origin, or OriginAttributes and confirm it validates the value against the process’s legitimate scope before acting.
  • Cookie and storage brokering
    Review other entry points into CookieServiceParent and related storage actors to ensure each performs the same ContentProcessHasCookie-style authorization check.
  • Trust-boundary forwarding
    Flag parent code that forwards child-provided parameters directly into privileged service calls without an intervening capability or ownership check.
diff --git a/dom/ipc/WindowGlobalParent.cpp b/dom/ipc/WindowGlobalParent.cpp
index 891ad30aba6..b2b38aecb1e 100644
--- a/dom/ipc/WindowGlobalParent.cpp
+++ b/dom/ipc/WindowGlobalParent.cpp
@@ -1823,6 +1823,10 @@ IPCResult WindowGlobalParent::RecvSetCookies(
   NS_ENSURE_TRUE(csParent, IPC_OK());
   auto* cs = static_cast<net::CookieServiceParent*>(csParent);
 
+  if (!cs->ContentProcessHasCookie(aBaseDomain, aOriginAttributes)) {
+    return IPC_FAIL(this, "Invalid set-cookie request from content process");
+  }
+
   return cs->SetCookies(aBaseDomain, aOriginAttributes, aHost, aIsThirdParty,
                         aCookies, GetBrowsingContext());
 }
Loading diff…