Document Title: =============== Facebook Bug Bounty #12 - Client Side Exception Web Vulnerability References (Source): ==================== http://www.vulnerability-lab.com/get_content.php?id=1190 Facebook Security ID: 186072579 Release Date: ============= 2014-02-07 Vulnerability Laboratory ID (VL-ID): ==================================== 1190 Common Vulnerability Scoring System: ==================================== 3 Product & Service Introduction: =============================== Facebook is an online social networking service, whose name stems from the colloquial name for the book given to students at the start of the academic year by some university administrations in the United States to help students get to know each other. It was founded in February 2004 by Mark Zuckerberg with his college roommates and fellow Harvard University students Eduardo Saverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes. The website`s membership was initially limited by the founders to Harvard students, but was expanded to other colleges in the Boston area, the Ivy League, and Stanford University. It gradually added support for students at various other universities before opening to high school students, and eventually to anyone aged 13 and over. Facebook now allows any users who declare themselves to be at least 13 years old to become registered users of the site. Users must register before using the site, after which they may create a personal profile, add other users as friends, and exchange messages, including automatic notifications when they update their profile. Additionally, users may join common-interest user groups, organized by workplace, school or college, or other characteristics, and categorize their friends into lists such as `People From Work` or `Close Friends`. As of September 2012, Facebook has over one billion active users, of which 8.7% are fake. According to a May 2011 Consumer Reports survey, there are 7.5 million children under 13 with accounts and 5 million under 10, violating the site`s terms of service. In May 2005, Accel partners invested $12.7 million in Facebook, and Jim Breyer added $1 million of his own money to the pot. A January 2009 Compete.com study ranked Facebook as the most used social networking service by worldwide monthly active users. Entertainment Weekly included the site on its end-of-the-decade `best-of` list, saying, `How on earth did we stalk our exes, remember our co-workers` birthdays, bug our friends, and play a rousing game of Scrabulous before Facebook?` Facebook eventually filed for an initial public offering on February 1, 2012, and was headquartered in Menlo Park, California. Facebook Inc. began selling stock to the public and trading on the NASDAQ on May 18, 2012. Based on its 2012 income of USD 5.1 Billion, Facebook joined the Fortune 500 list for the first time, being placed at position of 462 on the list published in 2013. (Copy of the Homepage: http://en.wikipedia.org/wiki/Facebook ) Abstract Advisory Information: ============================== The Vulnerability Laboratory Research Team discovered a client-side web vulnerability in the official Facebook Stories web-application api. Vulnerability Disclosure Timeline: ================================== 2014-01-06: Researcher Notification & Coordination (Benjamin Kunz Mejri - Vulnerability Lab) 2014-01-07: Vendor Notification (Facebook Security Team - WhiteHat Program) 2014-01-09: Vendor Response/Feedback (Facebook Security Team - WhiteHat Program) 2014-01-31: Vendor Fix/Patch (Facebook Developer Team) 2014-02-06: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== Facebook Product: FB Stories - Web Application (API) 2014 Q1 Exploitation Technique: ======================= Remote Severity Level: =============== Medium Technical Details & Description: ================================ A non-persistent input validation & filter vulnerability has been discovered in the official FacebookStories Online-Service web-application. The vulnerability allows remote attackers to inject own script code via POST method request on the client-side of the affected application. The vulnerability is located in the filename value of the photos module. The execute occurs in the exception-handling output of the upload image post method request. Remote attacker are able to provoke the application exception-handling to execute client-side script-code in the error message context itself. The encoding of the error message after an unsuccessful upload has is not the same way encoded like the other input fields of the formular. In our example pictures we show how the first injected code got parsed and why the secound client-side script code has in the error message been successful executed. The error output of the upload form exception does not encode the values of an invalid file name. The result is the client-side execute of the script code because of the values has not been saved to the database because of the invalid upload. Exploitation of the client-side exception web vulnerability requires no privileged facebook user account but low or medium user interaction. Successful exploitation of the remote vulnerability results in session hijacking, client-side phishing, client-side redirect to malicious context and client-side (non-persistent) manipulation of module (exception) context. Request Method(s): [+] POST Attack Vector(s): [+] Client-Side Vulnerable Module(s): [+] Add Photos/Video Files (Upload) Vulnerable Parameter(s): [+] filename (exception) Affected Module(s): [+] Error Exception-Handling - Parser Upload Proof of Concept (PoC): ======================= The non persistent web validation vulnerability in the exception-handling can be exploited by remote attackers without privileged web-application user account but low or medium user interaction. For security demonstration or to reproduce the vulnerability follow the provided information and steps below. PoC: post_video > post_video_file > [class err]
--- PoC Request Session Logs [POST] --- Status: 200[OK] POST http://www.facebookstories.com/photos Load Flags[LOAD_BYPASS_CACHE ] Content Size[-1] Mime Type[application/json] Request Headers: Host[www.facebookstories.com] User-Agent[Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0] Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8] Accept-Language[en-US,en;q=0.5] Accept-Encoding[gzip, deflate] DNT[1] X-CSRF-Token[ha1lc5Jr5+pQg8Avzn2rhK4tXxy/97XlEsDMQ0BkcKY=] Referer[http://www.facebookstories.com/stories/new] Content-Length[569] Content-Type[multipart/form-data; boundary=---------------------------165223053529112] Cookie[_fbstories_session=MWVnN0x1YjM2cXcrUGg2REVqbUNoR053Qnp4dks2UkJqZGNRazNOWmI1eGNGV20rVTFkamwyU2lna2E rRk1KRkFOUkdLRTdMK1RlL0JiZVdKdmZwcXQvMFViODBnYVFGbkQyNnNhRkprSHF5VlNmTnVGN3F3WG5JOGtkSVY0V1F0TjhvbE gyRlN5UWViODJKS2pCNTNiR3ZKZVhqUlVZNHd4Z2tycnAyUlNjNUpxeWR6TituckJZTkJLcmc1ZGJiWm1jdU5VNjBHc3lpaTVEW GhxV2E1dDE5dkp3RWppdWxwRXdpNjBDT3N1WTNnY0IwV0N4dStScnpIczd5YjZjb2tSWGR5NkpXQytTaStYSG1XcXBLNFE9PS0t ZGV5WjdnYnhzVWpyWUJXK0hmeVAwZz09--214c36970a1ec852af1df7176b22d5191856bc0c; __utma=260899354.1686033242.1387625718.1387625718.1387645958.2; __utmc=260899354; __utmz=260899354.1387625718.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=260899354.4.10.1387645958; page=1] Connection[keep-alive] Pragma[no-cache] Cache-Control[no-cache] Post Data: POST_DATA[-----------------------------165223053529112 Content-Disposition: form-data; name="name" ">