Skip to content
RCE Write-up Intermediate

Product Description

An authenticated attacker could inject operating system commands through the Name field of the SAML server configuration page, which were executed as root. This allowed complete control of the FortiWeb device.

rapid7.com

Published on rapid7.com

An OS command injection vulnerability in FortiWeb's management interface (version 6.3.11 and prior) can allow a remote, authenticated attacker to execute arbitrary commands on the system, via the SAML server configuration page. This is an instance of CWE-78: Improper Neutralization of Special Elements used in an OS…

Rapid7, on rapid7.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

Root cause

The application used the user-supplied 'Name' value directly in a shell command without sanitising it, allowing command injection.

Impact

An attacker could take complete control of the affected device with the highest privileges, and if the management interface were exposed to the internet, they could use it to reach further into the network.

What the attacker needed

Authenticated to management interface; management interface reachable

The fix

The vendor indicated that FortiWeb 6.4.1 is expected to include a fix, and users are advised to disable the management interface from untrusted networks until then.

How it was found

  1. Authenticate to the FortiWeb management interface.
  2. Send a POST request to the SAML remote server API endpoint with a crafted 'name' field containing backticks and a command.
  3. The command is executed as root on the underlying operating system.

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.

The FortiWeb management interface lets administrators configure SAML servers. The 'Name' field was passed to a system command without cleaning, so an attacker who could log in could type special characters that made the device run extra commands as the root user. This gave them full control of the device.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.