-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Advisory ID: SYSS-2018-041 Product: Firefox Manufacturer: Mozilla Affected Versions: <= 64 Tested Versions: 61, 62, 63, 64 Vulnerability Type: Information Exposure (CWE-200) Risk Level: Medium Solution Status: Open Manufacturer Notification: 2018-07-19 Solution Date: - Public Disclosure: 2019-01-16 CVE Reference: Not yet assigned Author of Advisory: Dr. Vladimir Bostanov, SySS GmbH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Overview: Mozilla Firefox is a web browser available for various platforms including Windows, Linux, Mac, Android, and iOS [1]. It is one of the most popular web browsers according to StatCounter [2]. An overly liberal same-origin policy for file URIs and a bug in the implementation of this policy make Firefox vulnerable to exposure of local files to a remote attacker. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Vulnerability Details: Firefox's same-origin policy for file URIs allows local files to read other files in the same directory but not the directory index [3]. For example, a file with the URI file:///home/joe/Dowloads/aFile.html can read file:///home/joe/Dowloads/anotherFile.html, but it should not be able to read file:///home/joe/Dowloads/. We discovered, however, a violation of this policy in the special case when a user first opens a local directory, e.g., file:///home/joe/Dowloads/, in the browser and from there navigates to a file in this directory, e.g., file:///home/joe/Dowloads/aFile.html. In this case, aFile.html can read the Downloads directory index. This allows a malicious script in aFile.html to read all files in this directory by referring to each of them by its respective filename, and to send all the data to a remote server controlled by the attacker. The following attack scenario seems plausible. A user saves a HTML file in the Downloads folder. The victim user might have received the file per email; or downloaded it from a malicious website offering, e.g. free eBooks, or picture albums, etc.; or downloaded it from a corporate website where a malicious employee had uploaded it. The victim clicks on the filename in the file manager. The file is opened with the default Firefox browser. The victim is presented with a directory index and a message explaining that the file is "protected" and the user should open it in "safe mode" by clicking on the link in the directory index. The victim clicks again on the filename, this time in the browser's directory listing. The contents of the HTML document is displayed. In the background, the malicious JavaScript reads, first, the directory index, then, the contents of each file in the Downloads directory, and sends all these data to a website controlled by the attacker. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Proof of Concept (PoC): We offer a test website [5] where a user can check if a browser is vulnerable to evilXHR. The above scenario is implemented by the following HTML file evilXHR.html:
evilXHR.html
is protected.
Click on the link evilXHR.html
below to open it in safe mode.
This file, evilXHR.html
, attempts to upload files from
your computer/mobile device to our server. In case of success, you will
find the copies of your files during the next 2 to 3 minutes at the
following
location (larger files take longer to upload):
Note: In the case of a real attack, some camouflage content (e.g., an eBook, or a picture album, etc.) will be displayed here instead of the current text, in order to conceal the data theft from the victim.
Diese Datei, evilXHR.html
, versucht Dateien von Ihrem
Computer oder mobilem Gerat auf unseren Server hochzuladen. Wenn das
gelingt, konnen Sie die Kopien Ihrer Dateien in den nachsten 2 bis 3
Minuten unter dem folgenden Link finden (grossere Dateien werden
langsamer hochgeladen):
Bemerkung: Im Falle eines echten Angriffs wurden hier statt dieses Texts andere Inhalte als Tarnung stehen (z.B. ein eBook, oder schone Bilder, usw.), damit das Opfer den Datendiebstahl nicht merkt.