Detect Fortinet FortiWeb OS Command Injection (CVE-2025-58034) in Google Chronicle
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
YARA-L Detection Query
rule fortiweb_os_command_injection_cve_2025_58034 {
meta:
author = "df00tech"
description = "Detects OS command injection exploitation against Fortinet FortiWeb (CVE-2025-58034)"
severity = "CRITICAL"
priority = "HIGH"
cve = "CVE-2025-58034"
reference = "https://fortiguard.fortinet.com/psirt/FG-IR-25-513"
events:
(
$e.metadata.product_name = /(?i)fortiweb/ or
$e.metadata.vendor_name = /(?i)fortinet/
)
(
$e.network.http.request_url = /[;|`]|&&|\$\(/ or
$e.network.http.request_url = /%3B|%7C|%26%26|%60|%24%28/ or
$e.security_result.summary = /(?i)(cmd.inject|os.command|command.inject|shell.exec)/ or
$e.target.process.command_line = /\/bin\/sh|\/bin\/bash/
)
condition:
$e
} Chronicle YARA-L rule detecting OS command injection attempts against Fortinet FortiWeb by matching shell metacharacters in HTTP request URLs and injection-related security result summaries.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate web traffic with special URL characters processed by FortiWeb
- FortiWeb configuration management scripts using shell commands
- Authorized red team or penetration testing activities
- Security scanner probes against FortiWeb management interfaces
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.