Closed Bug 2015647 (CVE-2026-12301) Opened 9 months ago Closed 6 months ago

No ContentProcessHasCookie check in HttpChannelParent::RecvSetCookies

Categories

(Core :: Networking: Cookies, defect, P1)

defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox150 --- wontfix
firefox151 --- wontfix
firefox152 --- fixed

People

(Reporter: kerberoasting, Assigned: valentin)

References

Details

(Keywords: ai-involved, reporter-external, sec-moderate, Whiteboard: [client-bounty-form][necko-triaged][necko-priority-queue][adv-main152+])

Attachments

(3 files, 1 external file)

Cookie READ — RecvGetCookieList (CookieServiceParent.cpp:268)

aHost is entirely child-controlled with zero validation against the process's assigned site. The parent calls GetCookiesForURI(aHost) and returns full cookie data. Non-HttpOnly cookie values are fully exposed. The child also controls aIsForeign and aStorageAccessPermissionGranted, bypassing all ETP filtering.

Side effect: UpdateCookieInContentList(aHost) at line 283 auto-adds the host to mCookieKeysInContent, unlocking RecvSetCookies for that domain.

Cookie WRITE — two paths completely bypass ContentProcessHasCookie:

  1. HttpChannelParent::RecvSetCookies (HttpChannelParent.cpp:1055) calls cs->SetCookies() directly at line 1070 — the internal method, not RecvSetCookies. ContentProcessHasCookie is never called. Any content process with an active PHttpChannel can write cookies for any domain.

  2. WindowGlobalParent::RecvSetCookies (WindowGlobalParent.cpp:1792) — same pattern, calls cs->SetCookies() directly at line 1809. Added in Bug 1839918 (Firefox 119) for bounce tracking. Every content process has a WindowGlobalParent.

Both paths call the internal SetCookies() (line 322), which only validates cookie syntax, not whether the content process is authorized for the target domain.

Impact: Compromised renderer on evil.com reads bank.com session cookies, then writes session-fixation cookies via HttpChannelParent or WindowGlobalParent and bypassing the defense built in Bug 1484026. No FIXME or TODO in any of these handlers idenfified.

Fix: Validate aHost base domain against ContentParent::GetRemoteType() in RecvGetCookieList. Route HttpChannelParent and WindowGlobalParent SetCookies through RecvSetCookies (or add equivalent origin check). Long-term: complete Bug 1491018.

See attached analysis

=== HOW DID YOU FIND THIS BUG ===

Manual source code audit of parent-side IPC cookie handlers. Traced child-controlled parameters through RecvGetCookieList and RecvSetCookies, found ContentProcessHasCookie is only enforced on 1 of 4 write paths, and the read path has no host validation at all.

=== POC & README TO BE ATTACHED ===

  1. submission_cookie_ipc_crossorigin.md — full code trace with all 4 vectors
  2. poc_cookie_ipc.py — Marionette PoC demonstrating parent-side cookie leak and content-process IPC access
Flags: sec-bounty?
Attached file poc_readme.txt —
Attached file poc_cookie_ipc.py —
Group: firefox-core-security → network-core-security
Component: Security → Networking: Cookies
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Closed: 9 months ago
Duplicate of bug: fission-cookies
Resolution: --- → DUPLICATE
Flags: sec-bounty? → sec-bounty-

AFAICT, this bug is the first report we got of missing validation specifically in the method HttpChannelParent::RecvSetCookies, so I'm going to undupe it. I'll mark it sec-moderate because that's what the other bugs have been. I'll find somebody to re-sec-bounty? this.

Status: RESOLVED → REOPENED
No longer duplicate of bug: fission-cookies
Ever confirmed: true
Keywords: sec-moderate
Resolution: DUPLICATE → ---
Summary: A compromised content process can read non-HttpOnly cookies for any domain and write cookies to any domain. The ContentProcessHasCookie defense (Bug 1484026) is bypassed on 3 of 4 cookie IPC paths. → No ContentProcessHasCookie check in HttpChannelParent::RecvSetCookies
Duplicate of this bug: 2038233

Simon, could you please move this back to sec-bounty?? It wasn't actually a dupe after all. Thanks.

Flags: needinfo?(sfriedberger)
Comment 6 is private: false

Valentin, could you please find somebody to work on this and the myriad other cookie principal validation issues that remain? We keep getting dupes of these and they seem to be among the more serious of the principal validation issues. Thanks.

Flags: needinfo?(valentin.gosu)
Flags: sec-bounty?
Flags: sec-bounty-
Flags: needinfo?(sfriedberger)
Assignee: nobody → valentin.gosu
Severity: -- → S3
Flags: needinfo?(valentin.gosu)
Priority: -- → P1
Whiteboard: [client-bounty-form] → [client-bounty-form][necko-triaged][necko-priority-queue]

(In reply to Andrew McCreight [:mccr8] from comment #4)

AFAICT, this bug is the first report we got of missing validation specifically in the method HttpChannelParent::RecvSetCookies, so I'm going to undupe it. I'll mark it sec-moderate because that's what the other bugs have been. I'll find somebody to re-sec-bounty? this.

The impact is the same as the other code paths.
The only reason it's not mentioned in other reports is that the code path is not used since bug 1977221.
Fortunatelly this is much easier to fix - we just remove the unused IPC message.

See Also: → fission-cookies
Attached file (secure) —

https://hg-edge.mozilla.org/mozilla-central/rev/10d8b190e65b

Do we need to do something for ESR140 still?

Group: network-core-security → core-security-release
Status: REOPENED → RESOLVED
Closed: 9 months ago → 6 months ago
Flags: needinfo?(valentin.gosu)
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch

Bug 1977221 landed in 143, and bug 1989488 in 144. These would also need to be uplifted if we wanted to fix 140.
It would be possible to add a ContentProcessHasCookie for ESR140 only, but that's also a bit risky since it's not riding the trains.

Depends on: 1977221, 1989488
Flags: sec-bounty? → sec-bounty+
QA Whiteboard: [sec] [qa-triage-done-c153/b152]

I think we should wontfix this for 140.
Uplifting to bug 1977221 and bug 1989488 140 wouldn't be too risky, but I don't think it's worth it unless we also fix bug 1788109.

Flags: needinfo?(valentin.gosu)
Whiteboard: [client-bounty-form][necko-triaged][necko-priority-queue] → [client-bounty-form][necko-triaged][necko-priority-queue][adv-main152+]
Alias: CVE-2026-12301
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: