Local privilege escalation via insecure MSI file
A non-admin user can force a repair of an MSI file in a world-readable folder, causing MsiExec to load a DLL from a world-writable temp folder, leading to SYSTEM privileges.
Originally disclosed on HackerOne
- Triaged in 31 hours
- Fixed in 4 months
- Paid in 7 days
- Disclosed after 7 months
Summary
I've found a vulnerability which leads to a local privilege escalation starting from a non-admin user.
When True Image client installs it drops 2 MSI files into C:\Windows\Installer folder.
Since this folder (by default) is readable by anyone, a non-admin user can execute commands like msiexec /fa installer_name.msi, which forces installer_name.msi to "repair" the program.
One of these 2 MSIs (i can't named it because MSI file names are random and unique for every installation) when forced to repair it creates a dll in %TEMP%\random_name and then, after some time, MsiExec.exe loads it. Since MsiExec.exe auto-escalate privileges when executed and %TEMP% is writable by anyone, this behavior could be abused to gain nt authority\system privileges.
Steps To Reproduce
- Open
%TEMP%andC:\Windows\Installer - Locate the MSI file in the installer folder: it's 1.3 GB large and has
Acronisas author - Open
cmd.exeand executemsiexec /fa C:\Windows\Installer\installer_name.msi. After few seconds a new folder will appear in%TEMP% - Replace
schedule.dllinside that folder with theschedule.dllattachment in this report - Wait until the process finishes. After some time a UAC should prompt, just select "no"
- A new cmd should pop up. Type
whoamito confirm the new privileges
I've also recorded a PoC video in case something it's not clear.
Recommendations
Do not use local %TEMP% to create schedule.dll, use C:\Windows\TEMP.
Impact
LPEs like this one are often used by malwares to evade antivirus engines, install rootkits, spread over the network, etc... A malware author could use this exploit to target Acronis end users.
Attachments
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
The installer creates a DLL in a world-writable temporary folder and later loads it with elevated privileges, allowing DLL hijacking.
Impact
A local attacker could gain SYSTEM privileges, which malware authors could use to evade antivirus, install rootkits, or spread over the network.
What the attacker needed
Non-admin user account; local access to the machine; True Image client installed
The fix
The installer should create the DLL in a secure location such as C:\Windows\TEMP instead of the user-writable %TEMP% folder.
How it was found
- Open the temp folder and the Windows Installer folder.
- Locate the large MSI file authored by Acronis in the installer folder.
- Run msiexec with the repair flag on that MSI file; a new folder appears in the temp folder.
- Replace schedule.dll inside that new folder with the provided malicious DLL.
- Wait for the process to finish; a UAC prompt appears, select 'no'.
- A new command prompt appears; run whoami to confirm SYSTEM privileges.
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.
A non-admin user can run a repair command on an installer file that is stored in a folder anyone can read. During repair, the installer creates a DLL in a temporary folder that any user can write to. Because the installer runs with high privileges, replacing that DLL lets the attacker run code as the system administrator.
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.