FortiMail path traversal, unauth RCE (CVE-2026-126147) [PoC]
CVE-2026-126147
CVE-2026-126147: FortiMail 8.0.0-8.0.1, 7.6.0-7.6.6, 7.4.0-7.4.8, and all 7.2 versions allow unauthenticated RCE via path traversal (CVSS 9.8). Update to 8.0.2 or later.
Exploitation confirmed - public proof-of-concept - CVE-2026-126147 is a critical path traversal in FortiMail 8.0.0 through 8.0.1, 7.6.0 through 7.6.6, 7.4.0 through 7.4.8, and all 7.2 versions that lets an unauthenticated attacker execute unauthorized code or commands on the appliance. Patched in 8.0.2 - update immediately.
Overview
FortiMail’s path traversal weakness stems from improper limitation of a pathname to a restricted directory. In plain terms, the appliance accepts crafted requests that use directory traversal sequences to reach files and functionality outside the intended restricted area. Because the boundary between safe and unsafe filesystem paths is not enforced, an attacker can reach parts of the system they should never touch.
Fortinet rates this flaw CRITICAL at CVSS 9.8, with a vector of network attack, low complexity, no privileges required, and no user interaction. That combination means a remote attacker can trigger it with simple, repeatable requests against a reachable interface. No credential, victim click, or special condition is needed.
Impact
Successful exploitation lets an unauthenticated attacker execute unauthorized code or commands on the FortiMail appliance. Since FortiMail is the mail security gateway, that level of access is serious. An attacker with command execution could intercept or alter mail flow, read sensitive message content, pivot deeper into the network, or use the appliance as a foothold for further attacks. This is the kind of pre-authentication access that turns a perimeter device into an entry point.
Organizations running affected versions should treat this as high exposure, especially where the administrative or mail interfaces are reachable from the internet.
Remediation and Mitigation
- Upgrade immediately. Move to FortiMail 8.0.2 or later, which fixes the path traversal. If you run 7.6.x, 7.4.x, or 7.2.x, apply the corresponding fixed release per Fortinet’s advisory.
- Restrict exposure. Limit access to management interfaces and trusted networks. Do not expose administrative or mail interfaces broadly until you have patched.
- Monitor for abuse. Review logs for unusual traversal patterns (encoded
../sequences) and unexpected command execution or file access on the appliance. - Check for compromise. Inspect for rogue accounts, altered configurations, and outbound connections you did not authorize.
Security Insight
FortiMail devices have attracted real threat-actor interest before. A recent FortiMail zero-day was exploited in live campaigns, and the same ecosystem has seen repeated targeting of Fortinet perimeter products, as with this FortiClient EMS flaw used to deploy a credential stealer. A pre-authentication flaw in a mail gateway is an attractive target for the same actors, so do not wait for exploitation reports before patching. For broader context on active campaigns this month, see our weekly threat roundup.
Further Reading
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Public PoC References
Unverified third-party code
These repositories are publicly listed on GitHub and have not been audited by Yazoul Security. They may contain malware, backdoors, destructive payloads, or operational security risks (telemetry, exfiltration). Treat them as hostile binaries. Inspect source before execution. Run only in isolated, disposable lab environments (offline VM, no credentials, no production data).
Authorized use only. This information is provided for defensive research, detection engineering, and patch validation. Using exploit code against systems you do not own or do not have explicit written permission to test is illegal in most jurisdictions and violates Yazoul's terms of use.
| Repository | Stars |
|---|---|
| googlesky/CVE-2026-126147 Containerised PoC for CVE-2026-126147 (Fortinet FG-IR-26-199): a path traversal (CWE-22) in the FortiMail management interface API lets an unauthenticated request write outside the restricted director | ★ 0 |
Showing 1 of 1 known references. Source: nomi-sec/PoC-in-GitHub.
Related Advisories
An improper limitation of a pathname to a restricted directory ('path traversal') vulnerability in Fortinet FortiMail 8.0.0 through 8.0.1, FortiMail 7.6.0 through 7.6.6, FortiMail 7.4.0 through 7.4.8,...
A directory traversal and file upload vulnerability allows an unauthenticated attacker to upload and execute arbitrary scripts on Check Point Management Server....
VMware vCenter contains a directory traversal vulnerability in the Syslog server. A malicious actor with network access to vCenter may exploit this issue to execute arbitrary code....
ColdFusion versions 2025.9, 2023.20 and earlier are affected by an Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability that could lead to arbitrary code execut...