CVE-2025-58325

8.2 HIGH

📋 TL;DR

This vulnerability allows local authenticated attackers on affected FortiOS versions to execute arbitrary system commands through specially crafted CLI commands. The flaw stems from incorrect functionality provisioning (CWE-684) in the command-line interface. Organizations running vulnerable FortiOS versions on FortiGate devices are affected.

💻 Affected Systems

Products:
  • FortiOS on FortiGate devices
Versions: FortiOS 7.6.0, 7.4.0-7.4.5, 7.2.5-7.2.10, 7.0.0-7.0.15, all 6.4.x versions
Operating Systems: FortiOS
Default Config Vulnerable: ⚠️ Yes
Notes: Requires local authenticated CLI access. All configurations with vulnerable versions are affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attacker to gain root privileges, exfiltrate configuration data, pivot to other network segments, and establish persistent backdoors.

🟠

Likely Case

Privilege escalation from limited user to administrative access, enabling configuration changes, credential harvesting, and lateral movement within the network.

🟢

If Mitigated

Limited impact due to restricted CLI access policies, command logging, and network segmentation preventing lateral movement.

🌐 Internet-Facing: LOW - Requires local authenticated access, not directly exploitable from internet.
🏢 Internal Only: HIGH - Internal users with CLI access can exploit this to gain elevated privileges and compromise the firewall.

🎯 Exploit Status

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

Exploitation requires authenticated CLI access. The vulnerability is in the CLI command processing logic.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: FortiOS 7.6.1, 7.4.6, 7.2.11, 7.0.16, and 6.4.15

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

Restart Required: Yes

Instructions:

1. Backup current configuration. 2. Download appropriate firmware from Fortinet support portal. 3. Upload firmware to FortiGate via GUI or CLI. 4. Reboot device to apply update. 5. Verify version after reboot.

🔧 Temporary Workarounds

Restrict CLI Access

all

Limit CLI access to trusted administrative users only using role-based access control

config system admin
edit <username>
set accprofile "super_admin"
end

Enable Command Logging

all

Enable detailed logging of all CLI commands for audit and detection purposes

config log setting
set cli-audit-log enable
end

🧯 If You Can't Patch

  • Implement strict role-based access control to limit CLI access to essential administrative personnel only
  • Enable comprehensive logging of all CLI commands and monitor for suspicious command patterns

🔍 How to Verify

Check if Vulnerable:

Check FortiOS version via CLI: 'get system status' or GUI: System > Dashboard. Compare against affected versions list.

Check Version:

get system status | grep Version

Verify Fix Applied:

After patching, verify version is 7.6.1, 7.4.6, 7.2.11, 7.0.16, or 6.4.15 or higher using 'get system status' command.

📡 Detection & Monitoring

Log Indicators:

  • Unusual CLI command sequences
  • Commands from non-admin users
  • Commands with unusual parameters or syntax

Network Indicators:

  • Unexpected outbound connections from FortiGate
  • Unusual administrative traffic patterns

SIEM Query:

source="fortigate" AND (event_type="cli" OR cmd="*" ) | search suspicious_command_patterns

🔗 References

📤 Share & Export