[doc.owncloud.org] CRLF Injection
A crafted URL containing an encoded carriage return and a Set-Cookie header was reflected into the Location response header, letting the attacker inject an arbitrary cookie for the whole domain. This could be combined with other flaws, such as cookie-based XSS, CSRF protection bypass or session fixation.
- Fixed in 8 days
- Disclosed after 3 months
PoC:
http://doc.owncloud.org/%23%0dSet-Cookie:crlf=injection;domain=.owncloud.org;
HTTP Response:
HTTP/1.1 301 Moved Permanently\r\n
Date: Wed, 27 Jul 2016 07:58:47 GMT\r\n
Server: Apache\r\n
Location: https://doc.owncloud.org/#\r < injection \r
Set-Cookie:crlf=injection;domain=.owncloud.org;\r\n
Result: Creating a cookie-param "crlf=injection" on *.owncloud.org
This vulnerability could be used in combination with others. For example, XSS via Cookie, bypass Double Submit Cookie csrf protection or session fixation. HTTP headers delimiter \r (%0d) is supported by any web browser other than FireFox.
HTTP Strict Transport Security can block the attack, if the user has already visited the site doc.owncloud.org.
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 redirect logic placed user-controlled URL data into the Location header without stripping carriage-return and line-feed characters, allowing header injection.
Impact
An attacker could set cookies across the whole domain, which may enable cookie-based XSS, bypass of double-submit-cookie CSRF protection or session fixation; HSTS blocks it only for users who already visited the site, and the technique does not work in Firefox.
What the attacker needed
Victim clicks a crafted link; browser other than Firefox; victim has not already visited the site (HSTS)
How it was found
- Request the documentation host with an encoded carriage return and a Set-Cookie header appended to the path.
- Observe the 301 redirect response.
- See the injected Set-Cookie header appear in the response and the cookie being set for the whole domain.
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.
When a web server redirects a visitor, it puts the new address in a response header. Here the site copied part of the requested address into that header without cleaning it, so an attacker could sneak in extra header text that sets a cookie. A cookie is a small piece of data a site stores in your browser, and one set for the whole domain can affect other subdomains.
What is Smuggling / CRLF?
A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.