CVE-2024-40593

6.0 MEDIUM

📋 TL;DR

This vulnerability allows authenticated administrators on affected Fortinet devices to retrieve certificate private keys via the admin shell. This affects FortiAnalyzer, FortiManager, FortiOS, and FortiPortal products across multiple versions. The exposure of private keys could lead to further compromise of encrypted communications.

💻 Affected Systems

Products:
  • FortiAnalyzer
  • FortiManager
  • FortiOS
  • FortiPortal
Versions: FortiAnalyzer 7.4.0-7.4.2, 7.2.0-7.2.5, all 7.0, all 6.4; FortiManager 7.4.0-7.4.2, 7.2.0-7.2.5, all 7.0, all 6.4; FortiOS 7.6.0, 7.4.4, 7.2.7, 7.0.14; FortiPortal all 6.0
Operating Systems: FortiOS (proprietary)
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated admin access to the device's admin shell. All affected versions in default configuration are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker with admin credentials could steal private keys, decrypt SSL/TLS traffic, impersonate legitimate services, or perform man-in-the-middle attacks against the device and connected systems.

🟠

Likely Case

Malicious insiders or compromised admin accounts could exfiltrate private keys, potentially compromising the confidentiality of encrypted communications managed by these devices.

🟢

If Mitigated

With proper access controls and monitoring, the impact is limited to authorized administrators who should already have high privileges, though key exposure remains a security concern.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

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

Exploitation requires admin credentials. The vulnerability is in the admin shell interface itself, making exploitation straightforward for authenticated attackers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check Fortinet advisory for specific fixed versions per product

Vendor Advisory: https://fortiguard.fortinet.com/psirt/FG-IR-24-133

Restart Required: Yes

Instructions:

1. Review Fortinet advisory FG-IR-24-133. 2. Identify affected devices and versions. 3. Upgrade to fixed versions as specified in advisory. 4. Restart devices after upgrade. 5. Verify fix by checking version and testing private key access.

🔧 Temporary Workarounds

Restrict Admin Shell Access

all

Limit admin shell access to only necessary personnel and implement strict access controls.

Monitor Admin Shell Activity

all

Enable detailed logging of admin shell sessions and monitor for unusual certificate-related commands.

🧯 If You Can't Patch

  • Implement strict role-based access control (RBAC) to limit admin shell access
  • Rotate all certificates whose private keys may have been exposed

🔍 How to Verify

Check if Vulnerable:

Check device version against affected versions list. If running affected version with admin shell access enabled, assume vulnerable.

Check Version:

get system status (FortiOS/FortiAnalyzer/FortiManager)

Verify Fix Applied:

After patching, verify version is no longer in affected range and test that private keys cannot be retrieved via admin shell.

📡 Detection & Monitoring

Log Indicators:

  • Admin shell sessions accessing certificate files or private key extraction commands
  • Unusual certificate-related operations in admin logs

Network Indicators:

  • Unexpected certificate changes or replacements
  • Anomalous SSL/TLS traffic patterns

SIEM Query:

Search for admin shell sessions with commands containing 'certificate', 'private key', or specific file paths to certificate stores

🔗 References

📤 Share & Export