Skip to content
Access control Disclosed report Advanced CVE-2026-6760

PCookieStore::GetRequestOnMainThread missing CheckContentProcessSecurity - cross-origin cookie read

The parent-side handler for cookie read requests in Firefox's CookieStore IPC protocol lacked the content-process security check that the equivalent set and delete handlers perform. A compromised content process could therefore request cookies for any domain, including cross-site, partitioned and private-browsing cookies, and supply forged origin attributes and principals.

Richard Belisle Follow

Originally disclosed on Mozilla

  • Fixed in 46 days
  • Paid in 53 days
  • Disclosed after 46 days
Text
Created attachment 9545219
test_renderer_compromise.py

=== Description ===
CookieStoreParent::GetRequestOnMainThread (dom/cookiestore/CookieStoreParent.cpp, lines 301-341) calls GetCookiesFromHost with a content-process-supplied cookieURI and returns the results. Unlike SetRequestOnMainThread (line 411) and DeleteRequestOnMainThread (line 490), which both call CheckContentProcessSecurity before operating, GetRequestOnMainThread has no such check.

A compromised content process creates a PCookieStore actor (AllocPCookieStoreParent at BackgroundParentImpl.cpp ~line 1450 does `new CookieStoreParent()` with zero validation) and sends GetRequest with an arbitrary cookieURI. All non-HttpOnly cookies for any domain are returned.

Three compounding issues in the same function:

1. Content-controlled boolean flags: thirdPartyContext, partitionForeign, usingStorageAccess, isOn3PCBExceptionList all come from the IPDL message. Setting thirdPartyContext=false skips the entire ShouldIncludeCrossSiteCookie check, bypassing Total Cookie Protection and SameSite enforcement.

2. Content-controlled OriginAttributes: partitionKey and privateBrowsingId come from the child. A compromised process reads cookies from any partition or from private browsing sessions.

3. Unvalidated PrincipalInfo on subscriptions: GetSubscriptionsRequest and SubscribeOrUnsubscribeRequest pass child-supplied PrincipalInfo to CookieStoreSubscriptionService with no validation.

CookieStore API is enabled by default (dom.cookieStore.enabled = true).

Suggested fix: add CheckContentProcessSecurity to GetRequestOnMainThread, matching Set (line 411) and Delete (line 490).

This is NOT a duplicate of Bug 1484026 — that covers CookieServiceParent (PNecko/PCookieService path). This is CookieStoreParent (PBackground/PCookieStore path) — different protocol, manager, and code file.

Attached PoC (test_renderer_compromise.py) demonstrates on Firefox ESR 140.7.0:

- Phase 1: Web API correctly blocks cross-origin cookie reads from attacker origin.
- Phase 2: Frame script in attacker's content process attempts docShell.createAboutBlankDocumentViewer(victimPrincipal) → content process CRASHES. AssertProcessPrincipal detects the forged principal. However, this check runs in the untrusted content process — a compromised renderer skips it and sends raw IPC.
- Phase 3: Parent-side GetRequestOnMainThread processes forged GetRequest with no CheckContentProcessSecurity. session_id and csrf_token (SameSite=Strict) returned. Partition boundary crossed via spoofed OriginAttributes.
- Phase 4: SetRequestOnMainThread (line 411) and DeleteRequestOnMainThread (line 490) both call CheckContentProcessSecurity. GetRequestOnMainThread does not.

=== How discovered ===
Static source code analysis of dom/cookiestore/CookieStoreParent.cpp, dom/cookiestore/PCookieStore.ipdl, ipc/glue/BackgroundParentImpl.cpp.

=== Attachments ===
1 test_renderer_compromise.py (4-phase Marionette PoC)

=== PoC prerequisites ===
pip install marionette_driver
Firefox ESR (tested on 140.7.0): apt install firefox-esr
Run: python3 test_renderer_compromise.py

The original report as published on Mozilla's Bugzilla, by Richard Belisle. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the GetRequestOnMainThread handler was written without the CheckContentProcessSecurity call that its sibling Set and Delete handlers use, and it also trusts child-supplied flags, origin attributes and principal information.

Impact

A compromised renderer could read cookies across origins, partitions and private browsing sessions, and the text notes the Web API itself correctly blocks cross-origin reads, so the weakness only matters once the content process is already compromised.

What the attacker needed

Compromised content process; ability to send raw IPC messages

The fix

The text suggests adding the same content-process security check to the read handler that the set and delete handlers already use.

How it was found

  1. Compromise the content process so it can send raw IPC messages.
  2. Create a PCookieStore actor, which the parent allocates with no validation.
  3. Send a GetRequest with an arbitrary cookie URI and forged origin attributes.
  4. Receive all non-HttpOnly cookies for the target domain, including SameSite=Strict values.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Firefox splits its work between a privileged parent process and less-trusted content processes that render web pages. When a page asks for cookies, the content process sends a message to the parent, which is supposed to verify the sender is legitimate before answering. Here the read path skipped that verification, so a hijacked renderer could ask for any site's cookies and get them back.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Richard Belisle

View all

3 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.