CVE-2022-39951

7.2 HIGH

📋 TL;DR

This CVE describes an OS command injection vulnerability in Fortinet FortiWeb web application firewalls. Attackers can execute arbitrary commands on affected devices by sending specially crafted HTTP requests. Organizations running vulnerable FortiWeb versions 6.3.6-6.3.20, 6.4 all versions, or 7.0.0-7.0.2 are affected.

💻 Affected Systems

Products:
  • Fortinet FortiWeb
Versions: 6.3.6 through 6.3.20, 6.4 all versions, 7.0.0 through 7.0.2
Operating Systems: FortiOS-based appliance
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments with vulnerable versions are affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the FortiWeb device leading to lateral movement into protected networks, data exfiltration, and persistent backdoor installation.

🟠

Likely Case

Unauthorized command execution allowing attackers to modify configurations, disable security controls, or use the device as a pivot point for further attacks.

🟢

If Mitigated

Limited impact due to network segmentation, restricted administrative access, and proper input validation preventing successful exploitation.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The vulnerability requires specially crafted HTTP requests but no authentication, making exploitation straightforward for attackers who discover the vulnerability.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: FortiWeb 7.0.3 or above, 6.3.21 or above, 6.4.1 or above

Vendor Advisory: https://fortiguard.com/psirt/FG-IR-22-254

Restart Required: Yes

Instructions:

1. Download the appropriate firmware update from Fortinet support portal. 2. Backup current configuration. 3. Apply firmware update via FortiWeb web interface or CLI. 4. Reboot device after update completes. 5. Verify version is updated to patched release.

🔧 Temporary Workarounds

Restrict Administrative Access

all

Limit management interface access to trusted IP addresses only

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

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate FortiWeb devices from critical systems
  • Deploy additional WAF or IPS solutions in front of vulnerable FortiWeb devices to detect and block exploitation attempts

🔍 How to Verify

Check if Vulnerable:

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

Check Version:

get system status | grep Version

Verify Fix Applied:

Confirm firmware version is 7.0.3+, 6.3.21+, or 6.4.1+ and test with known safe payloads if available

📡 Detection & Monitoring

Log Indicators:

  • Unusual command execution in system logs
  • HTTP requests with shell metacharacters or command injection patterns
  • Unexpected configuration changes

Network Indicators:

  • HTTP requests containing shell commands or special characters to FortiWeb management interfaces
  • Outbound connections from FortiWeb to unexpected destinations

SIEM Query:

source="fortiweb" AND (http_request CONTAINS "|" OR http_request CONTAINS ";" OR http_request CONTAINS "`" OR http_request CONTAINS "$")

🔗 References

📤 Share & Export