document.cookie does not reject invalid control characters
Firefox's document.cookie API accepted cookies containing invalid control characters such as form feed. An attacker controlling a sibling domain could set such a cookie, causing the browser to send malformed requests that Apache rejects with 400 Bad Request, blocking communication with the main domain.
- Fixed in 5 months
- Paid in 5 months
- Disclosed after 5 months
A sibling domain or a MITM can set cookies containing invalid control characters such as \f. On most server technology, such as Apache, requests containing illegal control characters will return a 400 Bad Request. As such attacker that can control sibling domain (eTLD+1) can inject such cookies into the cookie store and cause a situation where the Firefox client can no longer communicate with the main domain
Steps to reproduce:
1. Set cookie using document.cookie = "a=b\f"
2. Visit a website running Apache httpd.
3. Receive 400 Bad request. The Firefox client can no longer communicate with the Apache server so long as there is a current cookie store.
For reference, Chrome will now reject cookies set via document.cookie containing such control characters.
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
Impact
An attacker who controls a sibling domain could cause a Firefox user's browser to be unable to communicate with the main domain, effectively denying access to that site.
What the attacker needed
Attacker controls a sibling domain; victim uses Firefox; target runs Apache httpd
The fix
Firefox should reject cookies set via document.cookie that contain invalid control characters, as Chrome now does.
How it was found
- Set a cookie using document.cookie with a value containing a form feed character.
- Visit a website running Apache httpd.
- Observe that the server returns 400 Bad Request and the browser can no longer communicate with it while the cookie remains.
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 websites store in your browser. Some characters are not allowed in cookies because they break the rules of how web requests are formatted. Firefox allowed a forbidden character to be saved, so every later request to a strict server was rejected, effectively locking the user out of that site.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.