SecPod

Learn Search

Search across all Learn content

← Back to Security Research
Token Based SQLi in FortiWeb: Users Urged to Patch this Critical Flaw

Token Based SQLi in FortiWeb: Users Urged to Patch this Critical Flaw

A critical security vulnerability, CVE-2025-25257, has been discovered in FortiWeb web application firewalls, potentially allowing unauthenticated attackers to execute unauthorized SQL commands. This vulnerability, classified as CWE-89 (Improper Neutralization of Special Elements used in an SQL Comm...

Jul 13, 2025By Santosh Sethuraman3 min read

A critical security vulnerability, CVE-2025-25257, has been discovered in FortiWeb web application firewalls, potentially allowing unauthenticated attackers to execute unauthorized SQL commands. This vulnerability, classified as CWE-89 (Improper Neutralization of Special Elements used in an SQL Command), poses a significant threat to organizations that rely on FortiWeb for web application security.

Vulnerability and Exploit Details

The FortiWeb SQL injection vulnerability stems from improper input validation mechanisms within the product’s GUI component. An attacker can exploit this flaw by sending malicious HTTP or HTTPS requests containing specially crafted SQL payloads, bypassing the application’s security controls. This allows for SQL injection attacks, where malicious SQL code is injected into database queries, potentially enabling attackers to read, modify, or delete sensitive data stored in the backend database.

The flaw was discovered by comparing the /bin/httpsd endpoint, specifically the get_fabric_user_by_token function, in versions 7.6.3 and 7.6.4. In the older version, user-controlled input was inserted directly into the function without sanitization. This function is typically invoked by other Fortinet products authenticating to the FortiWeb API, meaning that supplying a crafted query here allows an attacker to bypass authentication entirely.

To understand how the exploit works, let’s first examine the fabric_access_check function that calls get_fabric_user_by_token. Here’s what it does:

  1. It retrieves the Authorization header from the incoming HTTP request.
  2. It uses a standard libc function to parse the header, expecting it to begin with Bearer up to 128 characters.
  3. It then calls the vulnerable get_fabric_user_by_token function without any sanitization.

Because there’s no validation or escaping before the input is passed into the MySQL query, an attacker can insert an SQL injection payload via the Bearer header. For example:

plaintext
GET /api/fabric/device/status HTTP/1.1Host: {host-ip}Authorization: Bearer AAAAAA'or'1'='1

This lets the attacker bypass authentication completely

Affected Versions

The vulnerability affects multiple FortiWeb versions across different release branches:

  • FortiWeb 7.6.0–7.6.3
  • FortiWeb 7.4.0–7.4.7
  • FortiWeb 7.2.0–7.2.10
  • FortiWeb 7.0.0–7.0.10

Impact

Successful exploitation of this vulnerability could lead to:

  • Complete system compromise
  • Data exfiltration
  • Service disruption
  • Lateral movement within the network infrastructure

Mitigation & Remediation

To mitigate this vulnerability, it is crucial to take the following steps:

  • Immediate Upgrade: Organizations should upgrade their FortiWeb installations to the patched versions specified for each affected branch. The patched versions are:
    • FortiWeb 7.6.4 or above
    • FortiWeb 7.4.8 or above
    • FortiWeb 7.2.11 or above
    • FortiWeb 7.0.11 or above
  • Interim Workaround: As an interim workaround, administrators can disable the HTTP/HTTPS administrative interface to reduce the attack surface until patching is completed.

Tactics, Techniques, and Procedures (TTPs)

Attackers can exploit this vulnerability using the following TTPs:

TA0001 – Initial Access: Attackers gain initial access by sending specially crafted HTTP or HTTPS requests to the FortiWeb management interface.

TA0002 – Execution: Attackers exploit the SQL injection vulnerability to execute unauthorized SQL code.

T1210 – Exploitation of Remote Services: Attackers exploit the remote services to gain unauthorized access.

T1190 – Exploit Public-Facing Application: Using an SQL Injection attack on the public-facing application.

Instantly Fix Risks with Saner Patch Management

Saner patch management is a continuous, automated, and integrated software that instantly fixes risks exploited in the wild. The software supports major operating systems like Windows, Linux, and macOS, as well as 550+ third-party applications.

It also allows you to set up a safe testing area to test patches before deploying them in a primary production environment. Saner patch management additionally supports a patch rollback feature in case of patch failure or a system malfunction.

Experience the fastest and most accurate patching software here.

Featured Posts

Open Root-Level RCE Flaw in Cisco Nexus 9000 Series Switches Exposes Networks to Complete Compromise — CVE-2026-20212
Root-Level RCE Flaw in Cisco Nexus 9000 Series Switches Exposes Networks to Complete Compromise — CVE-2026-20212

CVE Research

Root-Level RCE Flaw in Cisco Nexus 9000 Series Switches Exposes Networks to Complete Compromise — CVE-2026-20212

CVE-2026-20212 is a critical vulnerability in Cisco Nexus 9000 Series Switches that use Silicon One ASICs. It allows an unauthenticated remote attacker to execute code with root privileges by sending crafted input to TCP ports 43210 and 43211, which are reachable in the default Layer 3 VRF. Exploitation can also crash the S1HAL process and force a device reload. This article covers how the vulnerability works, the affected product identifiers, its potential impact, available workarounds, and how to identify fixed software using the Cisco Software Checker.

Sep 4, 2026

Open SonicWall SMA 1000 Under Active Attack: Two Zero-Days Enable SSRF and Remote Code Execution
SonicWall SMA 1000 Under Active Attack: Two Zero-Days Enable SSRF and Remote Code Execution

CVE Research

SonicWall SMA 1000 Under Active Attack: Two Zero-Days Enable SSRF and Remote Code Execution

Sep 3, 2026

Open Introducing SecPod VEX Studio: Guided Vulnerability Exploitability Assessment for Open-Source Maintainers
Secpod_VEX_Studio For Open-Source Vulnerability Management

CVE Research

Introducing SecPod VEX Studio: Guided Vulnerability Exploitability Assessment for Open-Source Maintainers

A human-guided path from SBOM and vulnerability data to reviewable OpenVEX statements

Sep 2, 2026

Open Inside the PaperCut Zero-Day Attack Chain: Auth Bypass to Code Execution
Inside the PaperCut Zero-Day Attack Chain: Auth Bypass to Code Execution

CVE Research

Inside the PaperCut Zero-Day Attack Chain: Auth Bypass to Code Execution

Sep 1, 2026