Skip to content
File upload Write-up Intermediate

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.

David Yesland Follow

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.

David Yesland, on rhinosecuritylabs.com

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

  1. Start FortiClient with Electron remote debugging enabled.
  2. Attach Chrome DevTools to the FortiClient process.
  3. In the UI, enable editing of the backup file path field.
  4. 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.

More by David Yesland

View all

3 more disclosed reports, best first.

More from Fortinet

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.