# CVE-2026-21643: Pre-auth SQL injection in FortiClient EMS multi-tenant mode

An unauthenticated attacker can inject SQL through the Site HTTP header of FortiClient EMS 7.4.4 and may reach code execution. Defused saw exploitation from about March 24, 2026, and CISA added the CVE to the KEV catalog on April 13, 2026.

- Vendor: Fortinet, FortiClient EMS 7.4.4
- Severity: CRITICAL (CVSS 3.1 9.1)
- Exploited (CISA KEV): yes, added 2026-04-13
- EPSS: 97.7% on 2026-11-23
- Public exploit: yes
- Patch available: yes
- Vendor advisory: FG-IR-25-1142, https://fortiguard.fortinet.com/psirt/FG-IR-25-1142
- Published: 2026-02-06; updated: 2026-10-12
- Page: https://patchtonight.com/cve/CVE-2026-21643/

## Affected and fixed versions

| Affected | Fixed in |
| --- | --- |
| FortiClient EMS 7.4.4 (multi-tenant "Sites" mode enabled) | 7.4.5 or later (but see CVE-2026-35616 below) |
| FortiClient EMS 7.2, 8.0 | Not affected |
| FortiClient EMS Cloud | Not affected |

## What it is

FortiClient EMS 7.4.4 builds a PostgreSQL `search_path` from the **`Site` HTTP header** without cleaning it. In multi-tenant mode that header selects the tenant. The code that reads it runs before authentication, so anyone who can reach the EMS web interface can inject SQL with a single crafted request. Fortinet says this may allow unauthorized code or commands.

Bishop Fox traced the bug to a refactor of the middleware and database connection layer in 7.4.4. Fortinet found it internally (credit: Gwendal Guégniaud, Fortinet Product Security). Defused later saw it exploited in the wild, and CISA lists it as known exploited.

Mind the trap: **upgrading to 7.4.5 is not the end.** Versions 7.4.5 and 7.4.6 are affected by [CVE-2026-35616](/cve/CVE-2026-35616/), a separate pre-auth bypass that Fortinet says was also exploited. Cloud Security Alliance and Greenbone both point out that people who patched this bug landed on that one.

## Am I affected?

You're exposed if **both** are true:

1. You run **FortiClient EMS 7.4.4**.
2. **Multi-tenant "Sites" mode is on.** Bishop Fox says single-site deployments are not affected, because the vulnerable code can't be reached.

Fortinet lists EMS 7.2 and 8.0 as not affected, and removed FortiEMS Cloud from the affected list. Some third-party write-ups say 7.4.0 to 7.4.5; Fortinet's advisory lists only 7.4.4, so this page follows Fortinet.

Bishop Fox's check for multi-tenancy is an unauthenticated request to `/api/v1/init_consts`, then reading `data.consts.System.SITES_ENABLED` in the response. Fortinet doesn't document a check, so confirm it on a test system first.

Exposure is real. Defused counted about 1,000 internet-facing EMS servers in Shodan; Shadowserver counted about 2,000.

## What to do

1. **Upgrade EMS to 7.4.5 or later, then close the second hole.** 7.4.5 and 7.4.6 need the hotfix for CVE-2026-35616 described in Fortinet's advisory FG-IR-26-099 and the EMS release notes, or an upgrade to 7.4.7 or later, which Fortinet said would carry the fix. Do both in one maintenance window.
2. **If you can't patch tonight**, in this order of preference (Bishop Fox, Beazley):
   - Restrict HTTPS access to the EMS web interface to trusted management networks, or put it behind a VPN.
   - Turn multi-tenancy off if you don't need it. The vulnerable code stays but becomes unreachable. Check the impact on your sites first.
   - Put a WAF or reverse proxy in front that validates or strips the `Site` header. This is a stopgap.
3. **If EMS was reachable from the internet on 7.4.4 with multi-tenancy on,** assume compromise back to **mid-March 2026** (Defused saw attacks from about March 24). Hunt using the section below. Review EMS administrators and the policies it pushes to endpoints, and rotate credentials and secrets held on the server if you find anything.

Several vendors shipped IPS or WAF signatures, for example FortiGate and FortiWeb ID 40000016, Check Point `asm_dynamic_prop_CVE_2026_21643` and TippingPoint 46296 (Picus lists the rest). Treat them as extra cover, not a fix.

## Detection

**No indicators of compromise (IPs, hashes, accounts) have been published** for this CVE. Fortinet has released none, and Defused, Cloud Security Alliance and Beazley all report none. Hunt for behaviour instead.

In the EMS Apache access logs (Bishop Fox, Beazley):

- **HTTP 500 responses on `/api/v1/init_consts`**. They are normally 200.
- Bursts of `init_consts` requests from one IP, especially mixed 200 and 500 status codes.
- Unusually slow responses on `/api/v1/init_consts` or `/api/v1/auth/signin`, a sign of time-based injection.

The default log format doesn't record the `Site` header, so the payload won't be visible there. In PostgreSQL logs, look for `SET search_path` statements with quotes, semicolons or SQL keywords. Statement logging is off by default; Bishop Fox suggests `log_statement = 'all'` only temporarily, because of the overhead. A failed injection can return an error such as `relation "system_settings" does not exist`.

On the server, Beazley suggests watching for:

- Unexpected EMS configuration changes or changes to endpoint policies.
- New user accounts or privilege changes.
- Unexpected processes spawned by EMS services.

## Sources

- [Fortinet advisory FG-IR-25-1142](https://fortiguard.fortinet.com/psirt/FG-IR-25-1142)
- [CVE record (includes CISA KEV listing)](https://cveawg.mitre.org/api/cve/CVE-2026-21643)
- [Bishop Fox root-cause analysis](https://bishopfox.com/blog/cve-2026-21643-pre-authentication-sql-injection-in-forticlient-ems-7-4-4)
- [Security Affairs, exploitation reported by Defused](https://securityaffairs.com/190158/security/critical-fortinet-forticlient-ems-flaw-exploited-for-remote-code-execution.html)
- [Help Net Security](https://www.helpnetsecurity.com/?p=364218)
- [Fortinet advisory FG-IR-26-099 (CVE-2026-35616)](https://fortiguard.fortinet.com/psirt/FG-IR-26-099)
- [Beazley Security advisory](https://labs.beazley.security/advisories/BSL-A1167)
- [Picus Security analysis](https://www.picussecurity.com/resource/blog/cve-2026-21643-critical-sql-injection-in-fortinet-forticlient-ems-exploited-in-the-wild)

---

Data from PatchTonight (https://patchtonight.com), compiled from vendor advisories, CISA KEV and FIRST EPSS. Please credit PatchTonight and link to the CVE page when you use it.
