Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2025-25257: Unauthenticated SQL Injection to RCE in Fortinet FortiWeb Fabric Connector

Published Jul 17, 2025 · Updated 4 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days2 mentions · peak 1 in a dayToday
CVSS9.8Critical · v3.1
EPSS99.9%100th percentile
CISA KEVYesAdded Jul 18, 2025
In the wildActivePer CISA KEV
Vendor
Fortinet
IdentifiersCVE-2025-25257CWE-89 · Improper Neutralization of Special…

CVE-2025-25257 is a pre-authentication SQL injection vulnerability in the Fortinet FortiWeb administrative interface's Fabric Connector component. The get_fabric_user_by_token() function incorporates an attacker-controlled Authorization Bearer token into an SQL query without sufficient sanitization or parameterization. Crafted HTTP or HTTPS requests can therefore execute unauthorized SQL commands and bypass authentication checks. An exploitation chain uses MySQL file-writing functionality to plant Python startup code, then invokes a Python-based CGI handler to achieve remote code execution. Affected releases are FortiWeb 7.0.0–7.0.10, 7.2.0–7.2.10, 7.4.0–7.4.7, and 7.6.0–7.6.3. Exploitation in the wild has been observed since July 2025.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

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

Successful exploitation permits unauthorized database queries and commands, potentially exposing or modifying application data and bypassing authentication. Chaining SQL injection with file writing and Python startup processing enables arbitrary code execution with the Python process's privileges, potentially including root. This can result in complete compromise of appliance confidentiality, integrity, and availability, including unauthorized configuration changes and disruption of security services.

Mitigation

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

Until an upgrade can be completed, disable HTTP and HTTPS access to the FortiWeb administrative interface. Restrict management access to trusted administrative networks through network ACLs or a VPN to reduce exposure, and segment the appliance from internal systems. Monitor for suspicious Authorization headers, SQL errors, unauthorized administrative changes, and unusual outbound traffic. Access restrictions and monitoring are defense-in-depth measures, not substitutes for patching.

Remediation

Patch, then assume compromise.

Upgrade FortiWeb to a fixed release for the installed branch: 7.0.11 or later, 7.2.11 or later, 7.4.8 or later, or 7.6.4 or later. Prefer the latest supported release incorporating these fixes and subsequent security updates. Given confirmed exploitation, review authentication activity, administrative changes, unexpected appliance files, process execution, and outbound connections for evidence of compromise; patching does not remove an existing compromise.

Public exploits

Exploits

10 exploits validated by Mallory's analysis. Hidden: 4 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
CVE-2025-25257This 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.0xbigshaq · Disclosed Jul 11, 2025 · python · networkOperationalCVE-2025-25257-Exploit-ToolThis 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.adilburaksen · Disclosed Jul 12, 2025 · python · shell · networkOperationalCVE-2025-25257This 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.imbas007 · Disclosed Jul 12, 2025 · python · sh · networkOperationalAshwesker-CVE-2025-25257This 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.Ashwesker · Disclosed Jul 12, 2025 · python · markdown · networkOperationalCVE-2025-25257This 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.0xgh057r3c0n · Disclosed Jul 15, 2025 · python · networkOperationalCVE-2025-25257This 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.mrmtwoj · Disclosed Jul 19, 2025 · python · networkOperationalCVE-2025-25257This 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.TheStingR · Disclosed Jul 19, 2025 · python · networkOperationalCVE-2025-25257This 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-it · Disclosed Sep 21, 2025 · python · markdown · networkOperationalCVE-2025-25257This 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.aitorfirm · Disclosed Jul 12, 2025 · python · javascript · networkPoCcve-2025-25257This 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-boop · Disclosed Dec 16, 2025 · python · bash · networkPoC
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
FAQ

Frequently asked questions

Is CVE-2025-25257 exploited in the wild?
Yes. As of Nov 13, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Jul 18, 2025.
Is there a public exploit for CVE-2025-25257?
Yes. Mallory tracks 10 public exploits or proofs of concept for CVE-2025-25257, the earliest disclosed Jul 11, 2025.
Is there a patch for CVE-2025-25257?
Upgrade FortiWeb to a fixed release for the installed branch: 7.0.11 or later, 7.2.11 or later, 7.4.8 or later, or 7.6.4 or later. Prefer the latest supported release incorporating these fixes and subsequent security updates.
What products are affected by CVE-2025-25257?
Fortinet Fortiweb.
How severe is CVE-2025-25257?
CVE-2025-25257 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 99.9% (100th percentile) as of Nov 13, 2026.
Activity feed

Recent activity

137 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
gurucul threat researchNews · Nov 13, 2026Inside The Server: 14 Months of Offensive Cyber Operations Targeting Europe | Community Portal | GuruculUnknownRead more ↗group ibNews · Nov 11, 2026Inside The Server: 14 Months of Offensive Cyber Operations Targeting Europe | Group-IB BlogSQL injection vulnerability in Fortinet FortiWeb listed in the Targeted Vulnerabilities table. No successful exploitation or vulnerability-specific scanning is established. General recommendations include restricting management access to targeted edge products.Read more ↗mkd cirtNews · Oct 16, 2026Silent Lynx ја искористува ранливоста во WinRAR за да распореди обратна школка (Reverse Shell) во напади врз владини организации во ЗНД | MKD-CIRT | Национален центар за одговор на компјутерски инцидентиAn SQL injection vulnerability in Fortinet FortiWeb. Public exploit code was found in directories associated with the threat group, suggesting possible expansion of its capabilities. The article does not establish that the group exploited this vulnerability against victims.Read more ↗the hacker newsNews · Oct 15, 2026Silent Lynx Exploits WinRAR Flaw to Deploy Reverse Shell in CIS Government AttacksAn SQL injection vulnerability in Fortinet FortiWeb. A publicly available proof-of-concept exploit was found in staging directories linked to Silent Lynx, suggesting potential capability expansion. The content does not establish that the group exploited this vulnerability.Read more ↗
+23 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

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, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence2Every report linking this CVE to a named adversary.
Associated malware1Malware families linked to this CVE, with evidence and IOCs.
Detection signatures4YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity107Community discussion across Reddit, Mastodon, and other social sources.