Critical FortiClient EMS Flaw Allows Remote Code Execution; Update Urgently Required

Critical FortiClient EMS Vulnerability Exposes Systems to Remote Code Execution

A critical security vulnerability has been identified in Fortinet’s FortiClient Endpoint Management Server (EMS), designated as CVE-2026-21643. This flaw, carrying a CVSS score of 9.1, allows unauthenticated attackers to execute arbitrary SQL commands, potentially leading to remote code execution and full system compromise.

Understanding the Vulnerability

The vulnerability specifically affects FortiClient EMS version 7.4.4 when operating in multi-tenant mode. The root cause lies in a significant middleware refactoring introduced in this version, which altered the handling of database connections and tenant routing. During this update, a flaw was introduced in the database connection file that passes the HTTP `Site` header directly into a PostgreSQL `search_path` query without proper validation or sanitization. This oversight allows attackers to inject malicious SQL queries through the `Site` header, bypassing authentication mechanisms.

Exploitation Details

Researchers from Bishop Fox identified that the publicly accessible `/api/v1/init_consts` endpoint serves as a practical attack vector. Attackers can use this endpoint to determine if the multi-tenant mode is active. If enabled, they can inject SQL payloads via the `Site` header. Notably, this endpoint lacks rate limiting and brute-force lockout protections and returns PostgreSQL database error messages in the HTTP response body. This design flaw enables attackers to extract hidden data rapidly using error-based extraction methods in a single request, circumventing the need for slower time-based injection techniques.

Potential Impact

A successful exploitation of this vulnerability can lead to a complete compromise of the management database. Given that the database user in the Fortinet virtual machine operates with PostgreSQL superuser privileges, attackers can achieve remote code execution on the underlying host operating system. This access allows threat actors to steal administrator passwords, extract digital certificates, and view the complete inventory of managed devices. Such control enables the modification of security policies and the deployment of malicious configurations across an organization’s entire network of endpoints.

Indicators of Compromise

Administrators should be vigilant for the following signs that may indicate exploitation:

– Unusually long response times (5-20+ seconds) on `/api/v1/auth/signin` or `/api/v1/init_consts`, as recorded in Apache access logs.

– Repeated HTTP 500 responses from a single IP address targeting the `/api/v1/init_consts` endpoint.

– PostgreSQL error logs containing `search_path` statements with single quotes, semicolons, or SQL keywords such as `SELECT`.

Mitigation Measures

Fortinet has addressed this critical issue in version 7.4.5 by replacing format-string interpolation with parameterized identifier handling and securely escaping input. Organizations using FortiClient EMS 7.4.4 should upgrade to version 7.4.5 immediately to mitigate the risk.

For teams unable to apply the patch promptly, it is advisable to disable the multi-tenant Sites feature, as this prevents the vulnerable code path from being executed. Additionally, administrators should restrict web access to the EMS management interface to trusted internal networks only.

Conclusion

The discovery of CVE-2026-21643 underscores the critical importance of rigorous input validation and sanitization in software development, especially in security management systems. Organizations must remain vigilant, promptly apply security patches, and implement robust access controls to safeguard against such vulnerabilities.