CVE-2021-36180

8.1 HIGH

📋 TL;DR

This vulnerability allows authenticated attackers to execute arbitrary commands on FortiWeb web application firewalls by sending specially crafted HTTP requests to the management interface. It affects FortiWeb versions 6.4.1 and below, 6.3.15 and below, and 6.2.5 and below. Attackers need valid credentials to exploit this command injection flaw.

💻 Affected Systems

Products:
  • FortiWeb Web Application Firewall
Versions: 6.4.1 and below, 6.3.15 and below, 6.2.5 and below
Operating Systems: FortiOS (Fortinet proprietary OS)
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects the management interface. Requires authenticated access to exploit.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise allowing attackers to execute arbitrary commands with administrative privileges, potentially leading to data theft, lateral movement, or deployment of ransomware.

🟠

Likely Case

Authenticated attackers gaining shell access to the FortiWeb device, allowing them to modify configurations, intercept traffic, or use the device as a pivot point into the network.

🟢

If Mitigated

Limited impact due to network segmentation, strong authentication controls, and restricted management interface access preventing exploitation attempts.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires valid credentials for the management interface. The vulnerability is in parameter handling of HTTP requests.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: FortiWeb 6.4.2, 6.3.16, 6.2.6

Vendor Advisory: https://fortiguard.com/advisory/FG-IR-21-120

Restart Required: Yes

Instructions:

1. Download the appropriate firmware version from the Fortinet support portal. 2. Backup current configuration. 3. Upload and install the new firmware via the web interface or CLI. 4. Reboot the device after installation completes.

🔧 Temporary Workarounds

Restrict Management Interface Access

all

Limit access to the FortiWeb management interface to trusted IP addresses only.

config system interface
edit <interface_name>
set allowaccess https ssh
set trust-ip-1 <trusted_ip>
end

Enable Multi-Factor Authentication

all

Require MFA for all administrative accounts to reduce risk of credential compromise.

config user local
edit <username>
set two-factor enable
set two-factor fortitoken <token_serial>
end

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate FortiWeb management interfaces from untrusted networks.
  • Enforce strong password policies and regularly rotate administrative credentials.

🔍 How to Verify

Check if Vulnerable:

Check FortiWeb firmware version via web interface (System > Dashboard) or CLI command 'get system status'.

Check Version:

get system status | grep Version

Verify Fix Applied:

Verify firmware version is 6.4.2 or higher, 6.3.16 or higher, or 6.2.6 or higher after patching.

📡 Detection & Monitoring

Log Indicators:

  • Unusual command execution in system logs
  • Multiple failed authentication attempts followed by successful login
  • HTTP requests with unusual parameters to management interface

Network Indicators:

  • Unusual outbound connections from FortiWeb management IP
  • Traffic patterns suggesting command execution

SIEM Query:

source="fortiweb" AND (event_type="command_execution" OR http_uri="*cmd*" OR http_uri="*system*" OR http_uri="*exec*")

🔗 References

📤 Share & Export