[api.owncloud.org] CRLF Injection
A URL parameter on the ownCloud API host was reflected into the Location header of a redirect without stripping carriage-return characters, so an attacker could inject extra response headers. This allowed setting an arbitrary cookie scoped to the whole owncloud.org domain, which could be chained with other attacks.
- Fixed in 21 days
- Disclosed after 3 months
PoC:
https://api.owncloud.org/%23%0dSet-Cookie:crlf=injection2;domain=.owncloud.org;
HTTP Response:
HTTP/1.1 301 Moved Permanently\r\n
Date: Wed, 27 Jul 2016 10:28:01 GMT\r\n
Server: Apache\r\n
Strict-Transport-Security: max-age=63072000\r\n
X-Xss-Protection: 1; mode=block\r\n
Location: https://doc.owncloud.org/api/#\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.
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 target was built from the request path without filtering carriage-return and line-feed characters, so they were written into the Location header.
Impact
An attacker could set cookies across all owncloud.org subdomains, which could be combined with other flaws such as cookie-based XSS, CSRF protection bypass or session fixation; the technique worked in browsers other than Firefox.
What the attacker needed
Victim visits a crafted link; browser other than Firefox
How it was found
- Send a request to the API host with an encoded carriage return and a crafted Set-Cookie header in the path.
- Observe the 301 response containing the injected Set-Cookie header.
- The browser stores the cookie for the whole owncloud.org 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 sends a response, it separates the headers with special line-break characters. If a server copies part of the URL into a header without removing those characters, an attacker can sneak in extra headers of their own. Here that let the attacker plant a cookie that the browser would send to every owncloud.org subdomain.
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.