Original research
An anonymous upload with Facebook’s name on it
Original research by William Viana and Jorge Lería
Facebook launched Rooms on October 23, 2014. It was a discussion app where you could pick a different name for every room. The next day William Viana and I watched it upload a photo. A stranger in the room didn’t need to know my name. Did Facebook at least check that I was a Rooms user before hosting my file? Facebook’s launch announcement
We checked. The service accepted an upload without a logged-in account or a request token. It didn’t verify where the request came from, require the Rooms client to identify itself, or restrict the contents to photos and videos. We could supply the file, its name and its claimed type. It went onto Facebook and Instagram’s content delivery network (CDN), the servers that normally send you their pictures and videos. That gave the same bug two quite different audiences: the person opening a link and the browser deciding what to trust.
A download from Facebook
We used a harmless test binary in place of a photo and got a link starting on Facebook’s main domain. Opening it led to our file on the CDN. The browser handled the redirect and offered a download. From the recipient’s seat, Facebook appeared to be handing over the file.
A login page on Instagram
Then we tried a web page. The browser displayed our imitation Instagram login form from the CDN. The address bar really did contain an Instagram domain. On Android and in Firefox, the browser gave that familiar part more visual weight than the rest of the address. The browsers themselves didn’t offer saved login details on our form. That only happened with a misconfigured browser extension.
Could our page read the session cookie, the bit of data that keeps you logged in? Instagram restricted that cookie to its own host. Our page on the CDN couldn’t read it. The form demonstrated phishing risk. We never demonstrated theft of an existing session.
What else trusted those files?
- Facebook’s content security policy. Some CDN hosts also appeared on Facebook’s list of trusted script sources. If a Facebook page could be made to reference content there, the policy would accept the source. Hosting a file alone didn’t run it on Facebook.
- Other people’s browsers. We demonstrated that an unrelated page could cause a visitor’s browser to submit an upload. The visitor supplied the network connection for content somebody else had chosen.
- The CDN and its reputation. Anonymous hosting could leave Facebook paying for other people’s storage and bandwidth. Malware on the CDN could also attract blocklists and warnings affecting legitimate files. We reported both as risks. We didn’t measure a bill or observe a blocklisting.
We checked two further possibilities. Facebook’s legacy Flash cross-domain policy didn’t grant access to any host we’d obtained, so we had no evidence of private data being readable that way. The service also accepted files associated with server-side scripting languages. A server would have to be misconfigured to execute them. We demonstrated storage, not execution.
Facebook fixed the bugs and paid William and me a $1,500 bounty. The simplest way to explain our report was still to show William’s inbox. I had supplied the file. Facebook had supplied the address. Only one of our names was visible in the link.