Skip to content
Smuggling / CRLF Disclosed report Beginner

[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.

bobrov Follow

Originally disclosed on HackerOne

  • 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.

The original report as published on HackerOne, by bobrov. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Request the documentation host with an encoded carriage return and a Set-Cookie header appended to the path.
  2. Observe the 301 redirect response.
  3. 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.

More by bobrov

View all

39 more disclosed reports, best first.

More from ownCloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Request smuggling and header injection

The lesson behind this report.

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.