Detect Fortinet FortiWeb OS Command Injection (CVE-2025-58034) in Splunk
Detects exploitation of CVE-2025-58034, an OS command injection vulnerability (CWE-78) in Fortinet FortiWeb. This KEV-listed vulnerability allows attackers to inject and execute arbitrary OS commands through FortiWeb's management or inspection interfaces, potentially leading to full appliance compromise, lateral movement, and persistent access to network segmentation points.
MITRE ATT&CK
SPL Detection Query
index=network sourcetype IN ("fortinet:fortiweb", "fortigate_utm", "syslog")
(vendor="Fortinet" OR product="FortiWeb" OR host=*fortiweb*)
(
[search index=network sourcetype IN ("fortinet:fortiweb", "syslog")
(uri_path="*;*" OR uri_path="*|*" OR uri_path="*&&*" OR uri_path="*`*" OR uri_path="*$(*"
OR request="*%3B*" OR request="*%7C*" OR request="*%26%26*" OR request="*%60*" OR request="*%24%28*"
OR msg="*cmd_injection*" OR msg="*os_command*" OR msg="*command injection*"
OR process IN ("/bin/sh", "/bin/bash", "cmd.exe") | return src_ip]
)
| eval cve="CVE-2025-58034", risk="critical"
| stats count min(_time) as first_seen max(_time) as last_seen values(uri_path) as uri_paths values(src_ip) as source_ips by host, dest_ip, cve
| where count > 0
| sort - last_seen Splunk search for OS command injection exploitation against Fortinet FortiWeb. Correlates shell metacharacter injection patterns in URI paths and known injection signatures from FortiWeb logs.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Penetration testing or authorized red team exercises against FortiWeb
- URL-encoded special characters in legitimate application traffic inspected by FortiWeb
- Security scanners generating command injection test payloads
- FortiWeb diagnostic or debug commands logged during maintenance windows
Other platforms for CVE-2025-58034
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1FortiWeb Command Injection via URI Path Semicolon Delimiter
Expected signal: FortiWeb access logs showing HTTP GET request to /cgi-bin/module;id;whoami from test IP. CommonSecurityLog entry with RequestURL containing semicolons.
- Test 2FortiWeb Command Injection via URL-Encoded Shell Metacharacters
Expected signal: FortiWeb logs showing request URL containing %3B sequence. Network proxy or WAF logs showing URL-decoded form with semicolons.
- Test 3Simulated Post-Exploitation Shell Spawn from Web Process
Expected signal: Process execution log showing /bin/bash spawned with parent process www-data or httpsd equivalent. File creation event for /tmp/fortiweb_compromise_marker.txt.
- Test 4FortiWeb Management Interface Credential Stuffing and Command Injection Attempt
Expected signal: FortiWeb authentication log showing POST to management API with injection payload in password field. CommonSecurityLog DeviceAction showing authentication attempt with anomalous credential content.
Unlock Pro Content
Get the full detection package for CVE-2025-58034 including response playbook, investigation guide, and atomic red team tests.