>samit_hota
Back to advisories

Security Advisory · SH-2026-197

CRITICALCVE-2026-104286CVSS 9.8OPEN

CVE-2026-104286: Critical Arbitrary File Write in Fortinet FortiMail

Affected: Fortinet FortiMail

Samit Hota·
#kev#fortinet

A critical vulnerability in Fortinet FortiMail appliances allows remote, unauthenticated attackers to write arbitrary files across the underlying system using crafted HTTP or HTTPS requests. Assigned a CVSS v3.1 score of 9.8, the Fortinet FortiMail Path Traversal Vulnerability (tracked as CVE-2026-104286) combines standard directory traversal sequences with improper neutralization of NULL byte characters, enabling attackers to bypass file path restrictions on exposed administrative endpoints.

Technical Analysis of CVE-2026-104286

The vulnerability stems from flawed path sanitization and string processing within FortiMail’s web daemon. Under CWE-22, directory traversal vulnerabilities usually allow an attacker to escape the designated web root by supplying sequences such as ../. However, many web frameworks attempt to mitigate this by enforcing specific file extensions or prefix restrictions.

In this case, the handling routine fails to properly neutralize NULL bytes (%00 or \0). When an attacker appends a NULL character to a path payload, low-level system calls in C-based backend components treat the string as terminated at the NULL byte, dropping any trailing extension checks enforced by higher-level wrapper code. This combination allows an attacker to control both the destination directory and the actual filename written to disk.

The CVSS vector (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) highlights the severity:

  • Network Reachable (AV:N): Exploitation occurs over standard HTTP/HTTPS channels.
  • Zero Authentication Required (PR:N): Unauthenticated attackers can reach the vulnerable path parsing code.
  • Low Attack Complexity (AC:L) & No User Interaction (UI:N): Automated scripts can reliably deliver payloads without triggering user interaction or requiring pre-existing session state.

In practice, unauthenticated file write vulnerabilities on edge security gateways are equivalent to remote code execution (RCE). An attacker capable of placing arbitrary files on the filesystem can drop web shells into accessible web roots, overwrite operational cron jobs, or tamper with system binaries to achieve full system compromise.

Exploitation Context and Threat Landscape

Email gateways sit at the perimeter of corporate networks and often require external connectivity to process incoming messaging traffic or host user-facing webmail and administration interfaces. Threat actors heavily prioritize edge appliances like FortiMail because compromising them provides immediate, unmonitored foothold access into protected networks without triggering endpoint detection and response (EDR) agents that might run on standard endpoints or servers.

While specific ransomware campaigns leveraging this flaw remain unconfirmed, edge appliance vulnerabilities with unauthenticated arbitrary file write capabilities are routinely weaponized within hours or days of public exposure. Automated scanning scripts specifically seek open management interfaces on port 443 or 8443 to attempt generic directory traversal payloads combined with URL-encoded null bytes.

Required Remediation and Detection Tactics

Organizations deploying FortiMail must take immediate action to address this flaw:

  • Update Firmware: Apply the latest security patch from Fortinet immediately for your specific FortiMail release branch to fix the path parsing logic in the HTTP management service.
  • Restrict Access: Network-level controls should immediately isolate FortiMail management interfaces (HTTP/HTTPS) from the public internet. Restrict administration access strictly to internal management VLANs or trusted administrative IP ranges.
  • Forensic Inspection: Inspect web server logs (httpd or web service logs on the appliance) for suspicious incoming HTTP GET/POST requests containing ../, %2e%2e%2f, or %00 sequences directed at administrative scripts or asset uploads.
  • File System Integrity Checking: Check web application asset directories and executable paths for unauthorized executable scripts, unexpected .php or .py files, or recently modified system configurations.

Found something similar in your stack?

Let's find out before it becomes an incident.

Book an advisory call