Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
CriticalCISA KEVExploited in the wildPublic exploit

Unauthenticated SQL Injection in Fortinet FortiWeb Fabric Connector

IdentifiersCVE-2025-25257CWE-89· Improper Neutralization of Special…

CVE-2025-25257 is a critical pre-authentication SQL injection vulnerability in Fortinet FortiWeb affecting versions 7.6.0 through 7.6.3, 7.4.0 through 7.4.7, 7.2.0 through 7.2.10, and 7.0.0 through 7.0.10. The flaw is in the FortiWeb Fabric Connector component, specifically in handling requests to /api/fabric/device/status. Available reporting states the Bearer token from the HTTP Authorization header is processed by backend logic, including the get_fabric_user_by_token() function, and is incorporated into an SQL query without sufficient sanitization or parameterization. An unauthenticated attacker can send crafted HTTP or HTTPS requests to inject arbitrary SQL. Public technical reporting further indicates the SQL injection can be chained with MySQL file-write primitives such as SELECT ... INTO OUTFILE to write a malicious Python .pth file into the appliance filesystem, after which invoking a Python-based CGI script such as /cgi-bin/ml-draw.py can trigger code execution because Python processes .pth files at startup.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows unauthenticated execution of arbitrary SQL statements against the FortiWeb backend database. This can enable authentication bypass, unauthorized access to application data, data modification, and potentially full appliance compromise. Public reporting describes a practical path from SQL injection to remote code execution by writing attacker-controlled files to disk and triggering Python startup processing, which can result in execution with the privileges of the vulnerable FortiWeb process and has been reported in some sources as leading to root-level compromise. The vulnerability has been actively exploited in the wild, including reported deployment of web shells on exposed FortiWeb instances.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, disable or strictly restrict HTTP/HTTPS administrative interface exposure, especially from the public internet. Limit access to trusted management networks, VPNs, or allowlisted IPs via ACLs/firewall policy. Monitor requests to /api/fabric/device/status and inspect Authorization headers for malformed or suspicious Bearer tokens indicative of SQLi attempts. Perform file-integrity and log review for signs of compromise, and isolate potentially affected appliances if exploitation is suspected. These measures are temporary risk-reduction steps and do not replace upgrading to a fixed version.

Remediation

Patch, then assume compromise.

Upgrade FortiWeb to a fixed release. Reported fixed versions are 7.6.4, 7.4.8, 7.2.11, and 7.0.11 or later, depending on branch. Organizations should prioritize emergency patching of any internet-exposed or otherwise reachable administrative interfaces and verify that all HA members or standby appliances are also updated. After patching, review the appliance for indicators of compromise, including unexpected .pth files, web shells, modified CGI or Python files, suspicious administrative changes, and anomalous outbound connections, because active exploitation has been reported.
PUBLIC EXPLOITS

Exploits

10 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (5 hidden).

VALID 10 / 15 TOTALView more in app
Ashwesker-CVE-2025-25257MaturityPoCVerified exploit

This repository contains a working exploit for CVE-2025-25257, a critical unauthenticated SQL injection vulnerability in Fortinet FortiWeb (versions 7.6.0-7.6.3, 7.4.0-7.4.7, 7.2.0-7.2.10, 7.0.0-7.0.10). The exploit is implemented in a single Python script (CVE-2025-25257.py) and is accompanied by a detailed README.md explaining the vulnerability, affected versions, and exploitation steps. The exploit leverages a SQL injection in the /api/fabric/device/status endpoint, abusing the Authorization: Bearer header to execute arbitrary SQL. It chains this to achieve remote code execution by writing a shell script webshell to /migadmin/cgi-bin/x.cgi on the target, then uses a secondary payload to set executable permissions. Once deployed, the webshell can be accessed at /cgi-bin/x.cgi, and arbitrary commands can be executed by sending them in the User-Agent header of HTTP requests. The repository is well-structured, with clear separation between exploit code and documentation. The exploit is operational, providing a real webshell payload and demonstrating full compromise of the target system. No detection-only scripts are present; the code is a true exploit with post-exploitation capabilities.

AshweskerDisclosed Jul 12, 2025pythonmarkdownnetwork
cve-2025-25257MaturityPoCVerified exploit

This repository provides a vulnerable simulation of FortiWeb (CVE-2025-25257) for demonstration and testing purposes. The main exploit capability is a SQL injection vulnerability in the /api/system/fabric/config POST endpoint, where the Authorization header is directly concatenated into an SQL query without sanitization. This allows attackers to bypass authentication and extract sensitive data from the SQLite database, such as user credentials and configuration secrets. The repository includes a Dockerfile and docker-compose setup for easy deployment, with Python (Flask) as the main application language. The init_db.py script initializes the database with test data. The payload.txt file contains a simple bash payload, but the main exploit vector is SQL injection, not RCE. The repository is structured for educational use, simulating a real-world FortiWeb vulnerability, and is not a detection script or fake exploit.

lytianahkone-boopDisclosed Dec 16, 2025pythonbashnetwork
CVE-2025-25257MaturityPoCVerified exploit

This repository contains a Python exploit script (watchtowel.py) and a README.md for CVE-2025-25257, a vulnerability in Fortinet FortiWeb. The exploit leverages a SQL injection vulnerability in the '/api/fabric/device/status' API endpoint to achieve remote code execution. The attack works by injecting SQL commands to create a table, write a Python reverse shell payload in chunks, and then write this payload to a .pth file on the target system. The exploit then triggers the execution of this payload by accessing the '/cgi-bin/ml-draw.py' endpoint, which causes the Python interpreter to execute the malicious .pth file, resulting in a reverse shell connection to a hardcoded IP address and port (192.168.18.1:4444). The script requires the user to specify the target URL and optionally a proxy, and the reverse shell parameters must be manually changed in the code. The repository is operational and provides a working exploit for the vulnerability, with clear instructions and a walkthrough referenced in the README.

segfault-itDisclosed Sep 21, 2025pythonmarkdownnetwork
CVE-2025-25257MaturityPoCVerified exploit

This repository provides a fully functional exploit for CVE-2025-25257, a critical unauthenticated SQL injection vulnerability in Fortinet FortiWeb (versions <= 7.0.10, 7.2.10, 7.4.7, 7.6.3). The exploit is implemented in a single Python script (CVE-2025-25257.py) and is accompanied by a detailed README and an SVG diagram illustrating the attack workflow. The exploit works by sending a crafted HTTP request to the vulnerable /api/fabric/device/status endpoint, injecting SQL via the Authorization header. This allows the attacker to write arbitrary files to the server using MySQL's SELECT ... INTO OUTFILE functionality. The script writes a shell webshell to /migadmin/cgi-bin/x.cgi and a Python script to /var/log/lib/python3.10/pylab.py, which is then triggered to set the correct permissions on the webshell and clean up traces. Once deployed, the attacker can execute arbitrary system commands by sending them in the User-Agent header to the webshell URL. The repository is well-structured, with clear documentation, usage instructions, and visual aids. The exploit is operational and provides full remote code execution on vulnerable FortiWeb appliances, requiring only network access to the management interface. No authentication is needed. The code is not part of a framework and is standalone. The only code file is the Python exploit script, which is the main entry point.

TheStingRDisclosed Jul 19, 2025pythonnetwork
CVE-2025-25257MaturityPoCVerified exploit

This repository provides a proof-of-concept (PoC) exploit for CVE-2025-25257, a pre-authentication SQL injection vulnerability in Fortinet FortiWeb Fabric Connector versions 7.0 through 7.6.x. The exploit targets the /api/fabric/device/status HTTP API endpoint by injecting a malicious SQL payload in the Authorization: Bearer header. The repository contains two PoC scripts: one in Python (src/poc.py) and one in JavaScript (java/poc.js), both of which send a GET request to the vulnerable endpoint with the crafted header. Additionally, there is a detection script (src/detect.py) that scans logs for evidence of this exploit attempt. The README.md provides detailed vulnerability information, usage instructions, and a sample curl command. The exploit demonstrates the vulnerability but does not include weaponized payloads for remote code execution; it is intended for detection and validation of the SQL injection vector.

aitorfirmDisclosed Jul 12, 2025pythonjavascriptnetwork
CVE-2025-25257MaturityPoCVerified exploit

This repository contains a fully functional exploit for CVE-2025-25257, a critical unauthenticated SQL injection vulnerability in Fortinet FortiWeb's Fabric Connector API. The exploit is implemented in a single Python script (CVE-2025-25257.py) and is accompanied by a detailed README.md explaining the vulnerability and its impact. The exploit works by abusing the /api/fabric/device/status endpoint, which is vulnerable to SQL injection via the Authorization: Bearer header. The script chains SQL injection to write arbitrary files (using MySQL's SELECT ... INTO OUTFILE) to the target's filesystem, specifically deploying a shell script webshell to /migadmin/cgi-bin/x.cgi. It then triggers a chmod operation via another endpoint (/cgi-bin/ml-draw.py) to make the webshell executable. Once deployed, the attacker can execute arbitrary OS commands by sending them in the User-Agent header to the webshell URL. The script supports both single and multiple targets, optional proxying, and provides clear output on exploitation success. The exploit targets FortiWeb versions 7.6.0–7.6.3, 7.4.0–7.4.7, 7.2.0–7.2.10, and <=7.0.10. The attack vector is network-based, requiring only HTTP(S) access to the vulnerable API. The endpoints and file paths used in the attack are clearly defined in the code, making this a highly operational and weaponized exploit.

mrmtwojDisclosed Jul 19, 2025pythonnetwork
CVE-2025-25257MaturityPoCVerified exploit

This repository contains a single Python exploit script (CVE-2025-25257.py) targeting CVE-2025-25257, a critical unauthenticated SQL injection vulnerability in FortiWeb systems. The exploit abuses the /api/fabric/device/status endpoint, injecting SQL via the Authorization header to write a shell script (webshell) to /migadmin/cgi-bin/x.cgi using SQL INTO OUTFILE. It then uses a Python hook (written to /var/log/lib/python3.10/pylab.py and triggered via /cgi-bin/ml-draw.py) to set executable permissions on the webshell. Once deployed, the webshell allows arbitrary command execution by sending commands in the User-Agent header to /cgi-bin/x.cgi. The repository includes a README with detailed usage instructions, attack flow, and mitigation advice. The exploit is fully automated, requiring only the target URL as input, and demonstrates a complete chain from SQL injection to remote code execution. No detection scripts or fake code are present; this is a functional, operational exploit.

0xgh057r3c0nDisclosed Jul 15, 2025pythonnetwork
CVE-2025-25257MaturityPoCVerified exploit

This repository provides a Python-based exploit and vulnerability checker for CVE-2025-25257, a critical SQL injection and remote code execution vulnerability in FortiWeb devices. The repository contains two main scripts: 'vuln_check.py' (the primary exploit and checker) and 'exp.py' (a command execution tool for already-exploited targets). The exploit works by abusing the '/api/fabric/device/status' endpoint via a crafted Authorization header to perform SQL injection, which is then used to write a shell script (webshell) to '/migadmin/cgi-bin/x.cgi'. The webshell allows arbitrary command execution by sending commands in the HTTP User-Agent header. The exploit also uploads a Python script to set executable permissions on the webshell and cleans up after itself. The tool supports scanning single or multiple targets, logs results to 'vuln.txt', and provides clear output for operational use. The code is mature, operational, and provides a working payload for remote code execution on vulnerable FortiWeb devices.

imbas007Disclosed Jul 12, 2025pythonshnetwork
CVE-2025-25257-Exploit-ToolMaturityPoCVerified exploit

This repository contains a Python exploit for CVE-2025-25257, a pre-authentication SQL injection vulnerability in Fortinet FortiWeb appliances. The exploit script (exploit.py) can detect vulnerable versions by querying the /api/fabric/device/status endpoint and parsing the version information. If the target is vulnerable, the script uses SQL injection to upload a persistent shell script webshell to /migadmin/cgi-bin/x.cgi, which can be triggered via HTTP requests with commands sent in the User-Agent header. The exploit also uploads a Python script to /var/log/lib/python3.10/pylab.py to set the correct permissions on the webshell and then triggers its execution via the /cgi-bin/ml-draw.py endpoint. The README provides usage instructions and warnings about the destructive nature of the exploit. The repository is structured with a single main exploit script, a README, and a license file. The exploit is operational and provides a persistent remote shell on vulnerable FortiWeb appliances.

adilburaksenDisclosed Jul 12, 2025pythonshellnetwork
CVE-2025-25257MaturityPoCVerified exploit

This repository contains a working exploit and a proof-of-concept (PoC) for CVE-2025-25257, a critical SQL injection vulnerability in Fortinet FortiWeb (tested on version 7.6.1,build1010(GA.F),241126). The main exploit file, exp.py, leverages a SQL injection in the /api/fabric/device/status endpoint to achieve remote code execution (RCE) by uploading a shell script webshell to /cgi-bin/x.cgi. The webshell executes commands received via the HTTP User-Agent header, providing an attacker with a remote shell. The exploit also manipulates file permissions using a helper Python script written to /var/log/lib/python3.10/pylab.py. The signed.py file demonstrates arbitrary file read and write primitives using the same SQL injection vector, allowing an attacker to exfiltrate sensitive files (e.g., /etc/passwd) or write arbitrary files to the filesystem. The repository is well-structured, with clear separation between the full exploit and the PoC for file operations. No detection scripts are present; both scripts provide real exploit capabilities. The attack vector is network-based, requiring access to the vulnerable API endpoint over HTTPS.

0xbigshaqDisclosed Jul 11, 2025pythonnetwork
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
FortinetFortiwebapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence1

Every observed campaign linking this CVE to a named adversary.

Associated malware1

Malware families riding this exploit, with evidence and IOCs.

Detection signatures2

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity103

Community discussion across Reddit, Mastodon, and other social sources.

Unauthenticated SQL Injection in Fortinet FortiWeb Fabric Connector (CVE-2025-25257) | Mallory