Closed Bug 2038233 Opened 6 months ago Closed 6 months ago

HttpChannelParent SetCookies cookie validation bypass

Categories

(Core :: Networking: Cookies, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 2015647

People

(Reporter: jmwebdevelopement, Unassigned)

Details

(Keywords: reporter-external)

Steps to reproduce:

While looking at how cookies get set from content processes i noticed theres two paths that end up calling CookieServiceParent::SetCookies

The first path goes through PCookieService. CookieServiceParent::RecvSetCookies in netwerk/cookie/CookieServiceParent.cpp checks ContentProcessHasCookie before calling the internal SetCookies method. if the content process doesnt have cookies for that domain it returns IPC_FAIL

The second path goes through PHttpChannel. HttpChannelParent::RecvSetCookies in netwerk/protocol/http/HttpChannelParent.cpp calls CookieServiceParent::SetCookies directly without going through RecvSetCookies. it skips the ContentProcessHasCookie check entirely

The content process controls all the parameters baseDomain, host URI, the cookie structs. The host URI determines which domain the cookies get stored for. CookieValidation::ValidateForHost checks that the cookies domain attribute matches the supplied host but it doesnt check whether the content process should be allowed to set cookies for that host in the first place

To check if this actually works I called the internal cookie path from a parent process context for domains that werent being visited , example.com, example.org and example.net all three were accepted

could be something i missed but the ContentProcessHasCookie check exists for a reason on the PCookieService path and the PHttpChannel path just goes around it.
tested on Firefox ESR 140.10.1

Actual results:

cookies for example.com, example.org and example.net all accepted through the parent process cookie path with no origin restriction. the PHttpChannel path calls the same internal SetCookies method without the ContentProcessHasCookie check that the PCookieService path has

Expected results:

HttpChannelParent::RecvSetCookies should check ContentProcessHasCookie before calling SetCookies, same as CookieServiceParent::RecvSetCookies does. or the internal SetCookies method should check it itself so both paths are covered

Group: core-security → network-core-security
Status: UNCONFIRMED → RESOLVED
Closed: 6 months ago
Duplicate of bug: CVE-2026-12301
Resolution: --- → DUPLICATE
Group: network-core-security
You need to log in before you can comment on or make changes to this bug.