CVE-2022-26113: FortiClient Arbitrary File Write As SYSTEM
FortiClient's config backup feature validated the destination file path only in the UI, so a normal user could bypass the check and make the SYSTEM scheduler service write a file to any location with partially controlled contents. This could lead to privilege escalation, for example by writing a script to an administrator's startup folder.
Published on rhinosecuritylabs.com
Forticlient is Fortinet’s basic VPN client which offers SSL VPN and IPSecVPN VPN connectivity. It also contains utility features which allow importing and exporting of VPN configurations and profiles.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could write a file with partially controlled contents anywhere on the system as SYSTEM, which could lead to privilege escalation, for example by placing a script in an administrator's startup folder.
What the attacker needed
Local access to a Windows machine with FortiClient; ability to run FortiClient with debugging enabled
The fix
The issue was fixed in FortiClient 7.0.4 and 6.4.8, according to the vendor advisory.
How it was found
- Start FortiClient with Electron remote debugging enabled.
- Attach Chrome DevTools to the FortiClient process.
- In the UI, enable editing of the backup file path field.
- Call the config backup service function directly from the JavaScript console with an arbitrary path.
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 write-up has not been written yet. The Original tab links to the source.
FortiClient lets users back up their VPN settings. The program checked the chosen save location only in its window, not in the background service that actually writes the file. That service runs with high privileges, so a normal user could trick it into writing a file anywhere, including places that could let them run code as an administrator.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.