
Scanner and three-stage proof-of-concept exploit for CVE-2025-25257, a pre-auth SQL injection in Fortinet FortiWeb Fabric Connector that escalates to RCE via INTO OUTFILE.

Fast YAML-based vulnerability scanner with template-driven detection engine for automated security testing across web apps, APIs, networks, DNS, and cloud infrastructure.

Open-source web application security scanner for automated vulnerability detection, manual penetration testing, and API security testing with a proxy-based interception engine.

This repository contains the scanner component for Greenbone Community Edition.
Fortinet FortiWeb - SQL Injection
| field | value |
|---|---|
| CVE | CVE-2025-25257 |
| severity | critical |
| CVSS | 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| fixed in | 7.6.4, 7.4.8, 7.2.11, 7.0.11 |
| affected | 7.6.0 through 7.6.3, 7.4.0 through 7.4.7, 7.2.0 through 7.2.10, 7.0.0 through 7.0.10 |
| class | SQL injection (CWE-89), unauthenticated |
| scanner version | 1.0.0 |
| python | 3.8+ stdlib only, no third-party deps |
If you want the exploit, find it here: https://satoshidisk.com/pay/CT5bW1
FortiWeb's Fabric Connector authenticates peer Fortinet appliances with a
bearer token handled by get_fabric_user_by_token() in /bin/httpsd. The
vulnerable build interpolates the token straight into SQL:
select id from fabric_user.user_table where token='%s'. An unauthenticated
attacker breaks out of the literal with Authorization: Bearer 'or'1'='1
on GET /api/fabric/device/status, the injected OR returns a row, the
access check passes and the device status JSON is served with 200. The
watchTowr research escalates the same injection to RCE: the appliance MySQL
runs as root, so UNION SELECT ... INTO OUTFILE writes a Python .pth
site-hook (space-free /**/ payload, 127 bytes, inside the 128-char
sscanf "Bearer %128s" limit) and GET /cgi-bin/ml-draw.py makes the
interpreter execute it at startup.
An improper neutralization of special elements used in an SQL command
('SQL Injection') vulnerability [CWE-89] in FortiWeb may allow an
unauthenticated attacker to execute unauthorized SQL code or commands via
crafted HTTP or HTTPS requests. Affected: FortiWeb 7.6.0-7.6.3 (fixed in
7.6.4), 7.4.0-7.4.7 (fixed in 7.4.8), 7.2.0-7.2.10 (fixed in 7.2.11),
7.0.0-7.0.10 (fixed in 7.0.11). The nuclei template
(http/cves/2025/CVE-2025-25257.yaml, max-request: 1) sends one raw
request: GET /api/fabric/device/status with
Authorization: Bearer 'or'1'='1, and matches status == 200 together
with the body words serial, fortiweb and device_type (all
conjunctioned). A patched device answers 401 Unauthorized with an empty
body because 7.6.4 replaces the format-string query with a prepared
statement (SELECT id FROM fabric_user.user_table WHERE token = ?), so the
broken literal matches no row. The record is in the CISA KEV catalog
(EPSS 0.99921 per the template metadata).
GET /api/fabric/device/status with Authorization: Bearer 'or'1'='1.matchers-condition: and): response status
200 AND body contains serial AND fortiweb AND device_type. The
scanner case-folds the substring test; the real device status JSON emits
all three needles lowercase, so the folding cannot change the verdict on
a genuine target.HTTPError bodies are read
instead of retried; scheme-less tagger hosts get http:// prepended.token fingerprints every CSV row; full details are base64
packed in result_b64.# scanner: streamed CSV + optional JSON sidecar
python scanner/CVE-2025-25257/scanner.py urls.txt 8 CVE-2025-25257.csv --json CVE-2025-25257.json
# exploit: result dict + optional CSV/JSON dumps
python exploit/CVE-2025-25257/exploit.py http://target --csv CVE-2025-25257.csv --json CVE-2025-25257.json --verbose
urls.txt is a plain file, one target per line, # for comments.
[*] Fortinet FortiWeb CVE-2025-25257 Fabric Connector SQL injection scanner (pre-auth Bearer token breakout)
scanner : CVE-2025-25257 v1.0.0
threads : 8 | csv: CVE-2025-25257.csv | json: CVE-2025-25257.json
[*] Fortinet FortiWeb CVE-2025-25257 Fabric Connector SQL injection scanner (pre-auth Bearer token breakout)
[2026-12-04 13:27:07] loaded 2 target(s) from urls.txt
[2026-12-04 13:27:07] [1/2] http://10.20.30.40 -> VULNERABLE
[2026-12-04 13:27:07] [2/2] http://10.20.30.41 -> not-vuln
[2026-12-04 13:27:07] json sidecar saved: CVE-2025-25257.json
[2026-12-04 13:27:07] summary: total=2 vulnerable=1 not-vuln=1 errors=0
[2026-12-04 13:27:07] timing : avg=308ms max=608ms wall=0.61s
[2026-12-04 13:27:07] report saved: CVE-2025-25257.csv
| column | meaning |
|---|---|
| n | 1-based row number |
| url | target as provided |
| status | ok / error |
| vulnerable | verdict |
| elapsed_ms | per-target timing |
| token | 12-char md5 over the row details |
| result_b64 | base64(JSON) full details |
scanner.py - detection only, stdlib, streamed CSV + JSON sidecar.README.md - this file.DESCRIPTION.md - deeper technical notes.../../exploit/CVE-2025-25257/exploit.py - three-stage POC (bypass
probe, INTO OUTFILE .pth write, cgi-bin trigger).| code | meaning |
|---|---|
| 0 | at least one target answered |
| 2 | every target errored |