CVE-2021-36166

9.8 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to efficiently guess administrative authentication tokens in FortiMail systems by observing certain system properties. It affects FortiMail versions before 7.0.1, potentially enabling unauthorized administrative access.

💻 Affected Systems

Products:
  • FortiMail
Versions: All versions before 7.0.1
Operating Systems: Fortinet's proprietary OS
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all FortiMail deployments with administrative interfaces accessible.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the FortiMail system, allowing attackers to read/modify emails, reconfigure security settings, and potentially pivot to internal networks.

🟠

Likely Case

Unauthorized administrative access leading to email interception, configuration changes, and potential data exfiltration.

🟢

If Mitigated

Limited impact if strong network segmentation and monitoring are in place, though authentication bypass remains possible.

🌐 Internet-Facing: HIGH - FortiMail systems are often internet-facing email gateways, making them prime targets for exploitation.
🏢 Internal Only: MEDIUM - Internal attackers could exploit this, but external threats pose greater risk due to internet exposure.

🎯 Exploit Status

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

The vulnerability allows efficient token guessing through observable system properties, making exploitation straightforward once understood.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 7.0.1 and later

Vendor Advisory: https://fortiguard.com/psirt/FG-IR-21-028

Restart Required: Yes

Instructions:

1. Backup current configuration. 2. Download FortiMail 7.0.1 or later from Fortinet support portal. 3. Upload and install the firmware update via web interface or CLI. 4. Reboot the system. 5. Verify successful upgrade and functionality.

🔧 Temporary Workarounds

Restrict Administrative Access

all

Limit administrative interface access 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 additional authentication factors for administrative access

config system admin
edit <admin_user>
set two-factor enable
set two-factor-method fortitoken
end

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate FortiMail from untrusted networks
  • Enable comprehensive logging and monitoring for authentication attempts and administrative actions

🔍 How to Verify

Check if Vulnerable:

Check FortiMail version via web interface (System > Dashboard) or CLI command: get system status

Check Version:

get system status | grep Version

Verify Fix Applied:

Confirm version is 7.0.1 or higher using: get system status | grep Version

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed authentication attempts from single source
  • Successful administrative login from unusual IP addresses
  • Configuration changes from unexpected sources

Network Indicators:

  • Unusual traffic patterns to administrative interfaces
  • Authentication requests from external IPs if restricted

SIEM Query:

source="fortimail" (event_type="admin_login" OR event_type="auth_failure") | stats count by src_ip

🔗 References

📤 Share & Export