Pre-Auth RCE Discovered in FortiWeb Fabric Connector
A pre-authentication SQL injection in FortiWeb's Fabric Connector allows an attacker to bypass authentication by sending a crafted bearer token. The attacker can then use MySQL's file-writing feature to place a Python file that executes code as root, achieving remote code execution.
medium.com
Published on medium.com
A critical vulnerability in Fortinet’s FortiWeb product has been uncovered and is now under active exploitation. Tracked as CVE-2025–25257, the flaw exists in the Fabric Connector component of FortiWeb, which integrates Fortinet’s Web Application Firewall (WAF) with the broader Fortinet Security Fabric.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
User input from the Authorization header is directly inserted into an SQL query without sanitisation, allowing SQL injection.
Impact
An unauthenticated attacker could execute arbitrary code with root privileges, and the vulnerability is under active exploitation with public proof-of-concept code available.
What the attacker needed
Network access to FortiWeb Fabric Connector API; no authentication required
The fix
Fortinet fixed the vulnerability by replacing unsafe SQL string formatting with secure prepared statements, and users should upgrade to the patched versions.
How it was found
- Send a request with a malicious bearer token that makes the SQL condition always true.
- The system authenticates the attacker without valid credentials.
- Use the SQL injection to write a Python .pth file into the site-packages directory via SELECT INTO OUTFILE.
- The .pth file is executed when Python scripts run, giving code execution as root.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
FortiWeb is a security appliance that protects websites. A part of it that talks to other Fortinet products trusted input from a login token without checking it properly, so someone could sneak in without a password. Once in, they could make the device run their own code with the highest permissions.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.