FireFox Same Site "Strict" Cookie Bypass via firefox/firefox-private protocol/schemes registered with the OS and using an external browser
The report claims that Firefox sends SameSite=Strict cookies when a navigation is handed off from another browser via a registered firefox:// style protocol handler, even though the request is cross-site. An attacker could use this to make a victim's browser send strict cookies to a target site, undermining CSRF protection.
Originally disclosed on Mozilla
- Fixed in 18 days
- Paid in 18 days
- Disclosed after 18 days
Dear Team,
Here are the vulnerability details.
Description SameSite is an attribute that can be set for cookies in web browsers. It is used to control how cookies are sent with cross-site requests. The SameSite attribute helps mitigate the risk of cross-site request forgery (CSRF) attacks and protects user privacy.
There are three possible values for the SameSite attribute:
-
Strict: When a cookie has the
SameSite=Strictattribute, it will only be sent in a first-party context. This means that the cookie will only be sent if the request originates from the same site as the one that set the cookie.Example:
PLAINTEXT Set-Cookie: mycookie=myvalue; SameSite=Strict; -
Lax:With
SameSite=Lax, cookies are allowed to be sent with top-level navigations and safe HTTP methods (like GET), but they will not be sent when the request is initiated by a third-party website through methods such as a cross-origin POST request.Example:
PLAINTEXT Set-Cookie: mycookie=myvalue; SameSite=Lax; -
None: Setting
SameSite=Noneallows cookies to be sent with both first-party and third-party requests. This is often used for scenarios where the cookie needs to be sent across different domains, such as when embedding content from one site into another.Example:
PLAINTEXT Set-Cookie: mycookie=myvalue; SameSite=None; Secure;
Uses of Same Site Cookies CSRF Protection: CSRF attacks involve an attacker tricking a user's browser into making an unintended request to a different site where the user is authenticated. If cookies are sent automatically with every request, the attacker could exploit this to perform unauthorized actions on behalf of the user. SameSite helps mitigate this risk by preventing cookies from being sent in certain cross-site scenarios.
What is Browser Fails to Protect Same Site Cookies If a browser fails to properly enforce the SameSite=Strict attribute for cookies, it can have security implications, particularly in the context of cross-site request forgery (CSRF) attacks. Here are the potential impacts:
- CSRF Vulnerability: The primary purpose of SameSite=Strict is to protect against CSRF attacks by preventing cookies from being sent in cross-site requests. If a browser fails to enforce this attribute, it could expose users to CSRF vulnerabilities. An attacker might be able to initiate unauthorized actions on behalf of a user if their cookies are automatically included in requests to a different site.
Ex. Daps Website/Program run inside firefox website, might have using SameSite cookie protection (now days most of them are doing it for CSRF protection) Now developer will think that because they have used SameSite Strict cookies, they are safe from CSRF attacks but because of this bypass they are still vulnerable.
-
Unauthorized Actions: CSRF attacks typically involve tricking a user's browser into performing actions on a target site without the user's consent. If SameSite=Strict is not enforced, an attacker could potentially perform actions, such as changing the user's account settings, making financial transactions, or performing any action that the user is authorized to do on the target site.
-
Cross-Site Tracking: SameSite=Strict also enhances privacy by preventing automatic cookie inclusion in cross-site requests. If this protection is not in place, third-party sites may have increased visibility into users' activities across different domains, leading to potential tracking and profiling.
-
Reduced Security by Design: SameSite=Strict is designed to be a security measure by default. If a browser fails to enforce it, the security posture of the web becomes weakened, as developers may rely on this protection when building and securing web applications.
Tested On Windows 11 Pro FireFox Window Version 121.0
The POC Video https://drive.google.com/file/d/12SSLaTQHiNWHYt-53zC3yPO3_NjGLrg7/view?usp=sharing POC Exploit Codes - Readily available below https://g00gle.in/samefirefox/ss.php https://g00gle.in/samefirefox/ss.html https://g00gle.in/samefirefox/attacker.html
1.Browse https://g00gle.in/samefirefox/ss.php and First click on 1) FirstSet Same Site Cookie Button which will create the same site strict cookie name as SecretCookie and its value as IUHUIGIGAIIGIGUIGSUIGIGIGSIGUIGUIFFTFDTRFYVUVBHJBHJ for website https://com.egghunter.in 2. Go back and now click on 2 ) Verify Same Site Cookie Are Se now because the cookies are set as Strict you won't find them request to https://com.egghunter.in this is how FireFox browser is protecting user from CSRF Attacks because g00gle.in is cross domain which is requesting to "com.egghunter.in" both are cross domain so Strict Cookie won't be pass. 3. Now from Google Chrome browse this https://g00gle.in/samefirefox/attacker.html , there will be button to "Open In FireFox" open it and click on Open in prompt. 4. It will redirect from chrome to firefox with URL pointing to https://com.egghunter.in/showcookie.php but this time the SameSite cookies are sent to that server, which shows we bypass the SameSite cookie protection of firefox browser.
Suggestion Do not send the same site a strict cookie via deeplink.
CVSS Score
-
Attack Vector (AV): Network (N)
- Reason: The attack is conducted remotely, targeting the network. This aligns with the scenario where a browser fails to protect SameSite=Strict cookies, and an attacker can exploit the vulnerability remotely.
-
Attack Complexity (AC): Low (L)
- Reason: Exploiting the failure in SameSite=Strict is not particularly complex and can be achieved with relatively low effort.
-
Privileges Required (PR): None (N)
- Reason: The assumption is that the attacker does not require any specific privileges to exploit the vulnerability. The attack can be carried out with minimal access.
-
User Interaction (UI): Required (R)
- Reason: Victim needs to interact with attacker URL.
-
Confidentiality (C): High (H)
- Reason: The failure to protect SameSite=Strict cookies can lead to a high impact on confidentiality, potentially exposing sensitive information (cookies).
-
Integrity (I): High (H)
- Reason: The integrity of the system is highly impacted by the vulnerability, as the attacker can tamper with data or perform unauthorized actions using CSRF attack which is most important part of introducing same site cookies.
-
Availability (A): Low (L)
- Reason: The assumption is that while the vulnerability has an impact on availability, it is not as severe as the impacts on confidentiality and integrity. The focus is on data manipulation rather than denial of service.
Impact
-
CSRF Vulnerability: The primary purpose of SameSite=Strict is to protect against CSRF attacks by preventing cookies from being sent in cross-site requests. If a browser fails to enforce this attribute, it could expose users to CSRF vulnerabilities. An attacker might be able to initiate unauthorized actions on behalf of a user if their cookies are automatically included in requests to a different site.
-
Unauthorized Actions: CSRF attacks typically involve tricking a user's browser into performing actions on a target site without the user's consent. If SameSite=Strict is not enforced, an attacker could potentially perform actions, such as changing the user's account settings, making financial transactions, or performing any action that the user is authorized to do on the target site.
-
Cross-Site Tracking: SameSite=Strict also enhances privacy by preventing automatic cookie inclusion in cross-site requests. If this protection is not in place, third-party sites may have increased visibility into users' activities across different domains, leading to potential tracking and profiling.
-
Reduced Security by Design: SameSite=Strict is designed to be a security measure by default. If a browser fails to enforce it, the security posture of the web becomes weakened, as developers may rely on this protection when building and securing web applications.
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 browser treats a navigation arriving through an OS-registered firefox:// protocol handler as same-site or first-party, so it attaches SameSite=Strict cookies to a cross-site request.
Impact
If confirmed, sites relying on SameSite=Strict for CSRF protection could have that protection bypassed, allowing unauthorised actions on a victim's account; the report only demonstrates cookie transmission, not an actual state-changing attack.
What the attacker needed
Firefox on Windows with protocol handler; Victim has a strict cookie for target site; Victim opens attacker page in another browser; Victim accepts the open-in-Firefox prompt
How it was found
- Open the test page in Firefox and click the button that sets a SameSite=Strict cookie for the target domain.
- Click the verify button and confirm the strict cookie is not sent on a normal cross-site request.
- In Chrome, open the attacker page and use its button to open the target URL in Firefox.
- Observe that Firefox now sends the strict cookie to the target server.
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.
Cookies are small pieces of data a site stores in your browser so it can recognise you later. The SameSite=Strict setting tells the browser never to send that cookie when you arrive from a different website, which blocks a common trick called CSRF where another site makes your browser act as you. The report says Firefox breaks that rule when a link is opened from another browser through a special firefox:// link, so the cookie goes along anyway.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.