Arbitrary target directory for result files of update process
The update process allowed an attacker to choose an arbitrary target directory for result files, and because extracted patch files are also placed there, this could lead to changing arbitrary files. A proof of concept demonstrated this on Windows 7 with a nightly Firefox build.
Originally disclosed on Mozilla
- Fixed in 7 months
- Paid in 7 months
- Disclosed after 7 months
Created attachment 8717491
invalid.loc.poc.zip
It's possible to choose an arbitrary target directory for result files of an update process. As in Bug 1177861 this leads to the possibility to change arbitrary files because for example extracted *.patch files from the .mar file are also placed in this directory.
I have tested the poc with win7 and ff 47 nightly installed to C:\Program Files (x86)\Nightly\:
To reproduce
- download poc and extract the files
- download http://releases.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-47.0a1.en-US.win32.complete.mar and place the file to <pocdir>/updatework/update.mar
- execute poc.rb
- a firefox directory will appear next to the poc.rb
As seen in Bug 1177861 a more advance poc can change arbitrary files through manipulating *.patch files and the use of junctions.
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
Impact
An attacker could change arbitrary files on the system, potentially leading to code execution or system compromise, as demonstrated with a proof of concept on Windows 7.
What the attacker needed
Windows 7; Firefox 47 nightly installed; local access to run the poc
How it was found
- Download the proof-of-concept and extract its files.
- Download the complete update file and place it in the updatework folder as update.mar.
- Run the proof-of-concept script.
- A Firefox directory appears next to the script.
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 Firefox updates itself, it unpacks files into a folder. This report says an attacker could make it unpack into any folder they wanted, not just the safe one. Because the unpacked files can include patch files that get applied, this could let an attacker overwrite other files on the computer.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.