Firefox arbitrary file delete vulnerability
The Firefox update directory on Windows was writable by all members of the Users group, and the uninstaller recursively deleted everything under it. A low-privilege attacker could place a junction inside that directory pointing at another location, so that when an administrator uninstalled Firefox the contents of the target folder were deleted.
Originally disclosed on Mozilla
- Fixed in 3 months
- Paid in 4 months
- Disclosed after 3 months
Firefox arbitrary file detete vuln
Basic Info
- Software Name: Firefox for Windows
- Software Version:111.0.1
- Test OS System:Windows 21H2 (19044.1826)
- Vuln Influence:Arbitrary File Delete,Local Privilege Escalation
- CWE:CWE-1386
Vuln Analyse
After installing Firefox on Windows, a path similar to C:\ProgramData\Mozilla-1de4eec8-1241-4177-a864-e594e8d1fb38\updates\E7CF176E110C211B will be created in the operating system. When an administrator uninstalls Firefox, the uninstall program will recursively delete all files and folders under this path.
- Problem 1:The permission of directory C:\ProgramData\Mozilla-1de4eec8-1241-4177-a864-e594e8d1fb38\updates\E7CF176E110C211B allow all user in Users group add file and directory in it.
C:\ProgramData\Mozilla-1de4eec8-1241-4177-a864-e594e8d1fb38\updates>icacls E7CF176E110C211B
E7CF176E110C211B BUILTIN\Users:(I)(OI)(CI)(F)
BUILTIN\Administrators:(I)(OI)(CI)(F)
NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
- Problem 2:On Windows, the recursive deletion feature can be exploited using symbolic links for attacks. For example, by creating a junction link for C:\ProgramData\Mozilla-1de4eec8-1241-4177-a864-e594e8d1fb38\updates\E7CF176E110C211B\poc and other paths, arbitrary file deletion can be achieved.
Proof Of Concept
We can finally get a system shell by trick listing here:https://www.zerodayinitiative.com/blog/2022/3/16/abusing-arbitrary-file-deletes-to-escalate-privilege-and-other-great-tricks.
In this part, we only proof the arbitrary file delete vuln.
-
an low privilege user attacker create a junction between C:\ProgramData\Mozilla-1de4eec8-1241-4177-a864-e594e8d1fb38\updates\E7CF176E110C211B\poc and C:\Users\admin\Desktop
mklink /J C:\ProgramData\Mozilla-1de4eec8-1241-4177-a864-e594e8d1fb38\updates\E7CF176E110C211B\poc C:\Users\admin\Desktop -
admin uninstall firefox
-
files in C:\Users\admin\Desktop will be deleted.
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 update directory was created with full control granted to the Users group, and the uninstaller followed junctions while deleting recursively without checking where they pointed.
Impact
An attacker could delete arbitrary files with the privileges of an administrator who uninstalls Firefox, and the report notes this could be chained to escalate to a system shell.
What the attacker needed
Local low-privilege account; administrator uninstalls Firefox
How it was found
- A low-privilege user creates a junction inside the Firefox update directory that points at an administrator's Desktop folder.
- The administrator uninstalls Firefox.
- The files in the administrator's Desktop folder are deleted.
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.
Some programs keep working files in a folder that every user on the computer is allowed to write to. When the program is removed, it deletes everything in that folder. If an ordinary user puts a shortcut there that points at a different folder, the removal process follows the shortcut and deletes files it should never touch.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.