⚠️

Disclaimer & Liability

The content provided on this website is for educational, research, and security awareness purposes only. Any unauthorized, illegal, or abusive use of the information, tools, and techniques discussed is solely the responsibility of the user. The author and publisher assume no liability for any damages, injuries, or consequences resulting from the misuse of this content.

CVE-2025-25257: Critical Unauthenticated SQL Injection in Fortinet FortiWeb | Alireza Bolbolabadi - Red Team Security
LOADING

CVE-2025-25257: Critical Unauthenticated SQL Injection in Fortinet FortiWeb

Affected Products: FortiWeb

Executive summary

CVE-2025-25257 affects Fortinet FortiWeb through an unsafe SQL query in the Fabric Connector authentication path. The vulnerability is remotely reachable without credentials and can be triggered with a crafted HTTP or HTTPS request. The supplied intelligence assigns CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, or 9.8.

Exploit and scanner material is publicly referenced, and the supplied sources state that the CVE is listed in the CISA KEV catalog. These factors make exposed vulnerable appliances a high-priority security concern.

Technical analysis

The affected code path handles a Fabric Connector bearer token in get_fabric_user_by_token() within /bin/httpsd. In vulnerable builds, the token is inserted directly into a SQL statement equivalent to:

select id from fabric_user.user_table where token='%s'

Because the value is not parameterized, an attacker can terminate the intended string literal and inject an additional SQL condition. The documented pre-authentication probe is:

GET /api/fabric/device/status

Authorization: Bearer 'or'1'='1

On an affected appliance, the injected condition returns a row, passes the access check, and causes the device status JSON to be returned with HTTP 200. The cited detection logic combines the HTTP status with the presence of serial, fortiweb, and device_type in the response body.

The supplied research also describes a possible escalation from SQL injection to remote code execution. It reports that the appliance MySQL service runs as root, allowing a UNION-based INTO OUTFILE operation to write a Python .pth startup hook. A subsequent request to /cgi-bin/ml-draw.py could cause the Python interpreter to execute the file. This escalation is described by the cited research, but the supplied context does not independently demonstrate execution against a live FortiWeb appliance.

Affected systems

  • FortiWeb 7.6.0 through 7.6.3; fixed in 7.6.4.

  • FortiWeb 7.4.0 through 7.4.7; fixed in 7.4.8.

  • FortiWeb 7.2.0 through 7.2.10; fixed in 7.2.11.

  • FortiWeb 7.0.0 through 7.0.10; fixed in 7.0.11.

Mitigation

  1. Upgrade FortiWeb to 7.6.4, 7.4.8, 7.2.11, or 7.0.11, according to the installed release branch. The supplied intelligence states that 7.6.4 replaces the format-string query with a prepared statement.

  1. Where patching is temporarily unavailable, restrict network access to administrative and API interfaces, particularly /api/fabric/device/status. Limit access to trusted administrators and required Fortinet peers.

  1. Review web, API, and reverse-proxy logs for requests to /api/fabric/device/status with anomalous Authorization headers, including SQL metacharacters, boolean operators, comments, or UNION-related syntax.

  1. Inspect MySQL and operating-system logs for unusual SQL activity, file-write operations, new administrative artifacts, or execution involving Python startup paths.

  1. Check the appliance for unexpected .pth files and other artifacts associated with ml-draw.py or the FortiWeb Python environment. Preserve relevant evidence before modifying suspected files.

  1. After remediation, verify that the affected endpoint no longer returns an HTTP 200 device-status response containing serial, fortiweb, and device_type. The supplied intelligence states that a patched appliance should return HTTP 401 with an empty body.

Active probes should be used only against systems the organization is authorized to assess.

Expert insight

This issue is more than a database disclosure flaw. The combination of unauthenticated network access, a simple request path, public exploit material, and a documented path toward code execution creates a direct threat to exposed FortiWeb appliances. The affected Fabric Connector should be treated as a security boundary: any token accepted by that path must be handled as untrusted input and placed into a parameterized query.

The public scanner behavior provides a useful validation pattern, but its HTTP 200 and response-field combination is a detection signal rather than proof of compromise. Organizations should combine endpoint testing with log review and filesystem and database inspection, particularly because successful exploitation may extend beyond the original bearer-token bypass.

The supplied sources also describe CVE-2026-135273, a separate unauthenticated SQL injection in the WP Directory Kit WordPress plugin through version 1.6.3. It is unrelated to FortiWeb but has similar implications for exposed web applications. The context does not identify the first fixed WP Directory Kit release, so remediation details for that issue should be confirmed through the authoritative vendor references.

advisory critical CVE-2026-135273 CVE-2025-25257
·
← Back to Writeups