OFFSEC · Offensive Security

FortiMail’s Encryption Front Door: An Unpatched File Write, and Archiving Reconfigured to Copy Mail

Fortinet disclosed an unauthenticated arbitrary file write in FortiMail on 1 October, already exploited, with no fixed firmware available. The post-exploitation step in Fortinet's own indicators is a new archive account pointing at attacker infrastructure, which means a future upgrade will not close it.

What Fortinet published

On 1 October, Fortinet published advisory FG-IR-26-175 for CVE-2026-104286, a critical flaw in FortiMail rated CVSS 9.8. The advisory describes “An Improper Limitation of a Pathname to a Restricted Directory (‘Path Traversal’) [CWE-22] and Improper Neutralization of NULL Byte or NULL Character [CWE-158] vulnerability” that “may allow an unauthenticated attacker to write arbitrary files on the underlying system via crafted HTTP or HTTPS requests” [1][4]. The affected component is listed as the appliance’s graphical interface, the attack as unauthenticated, and the flaw as known-exploited [1].

The affected branches are FortiMail 8.0.0 through 8.0.1, 7.6.0 through 7.6.6, 7.4.0 through 7.4.8 and 7.2.0 through 7.2.9 [1][5][6]. Fortinet credits internal discovery to Gwendal Guegniaud of its product security team [1][5]. SecurityWeek records the advisory’s instruction plainly: “This has been reported to be exploited in the wild; customers are urged to apply the workaround” [6].

The word “workaround” is doing the work in that sentence. At disclosure there was no fixed firmware. Fortinet lists 8.0.2, 7.6.7 and 7.4.9 as resolutions without publishing a release date, and 7.2.x is given no fix at all, only an instruction to move to 7.4 or later [1][3][6]. An operator reading the advisory on the day had a mitigation and nothing to install.

The feature that is the attack surface

The mitigation Fortinet puts first is to disable Identity Based Encryption. That matters more than a one-line workaround usually does, because of what the feature is for. FortiMail’s own administration guide explains that when a message is encrypted this way, the appliance sends a notification containing “an HTML attachment, which contains instructions and links telling the recipient how to access the encrypted email”, and that a first-time recipient must “follow the instructions and links to register on FortiMail before reading email” [10].

In other words, the feature exists so that people outside the organisation can authenticate to the mail gateway itself. The guide notes that “External IBE users can only access their secure messages via the link in the IBE notification email” [10]. That function has to be reachable from the public internet to work at all, which is precisely why a flaw in its request handling is reachable without credentials.

So the workaround is not free. Disabling it breaks secure delivery to external recipients, which for many organisations is the control cited in a regulatory or contractual commitment. Fortinet’s alternatives are to restrict webmail access to trusted private networks, or to place a web application firewall rule blocking traversal sequences on the relevant path [1][2]. The first option has the same consequence for external recipients; the second depends on an appliance many FortiMail deployments do not have in front of them. watchTowr’s reading is the practical one: disable the feature or restrict the interface, and treat both as interim [2].

Why a null byte belongs in the headline

The pairing of weaknesses is worth understanding, because it explains why input filtering that looks adequate is not. CWE-22 covers the familiar case: the product “does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory”, classically through “../” sequences [8].

CWE-158 is the quieter half. MITRE describes it as a failure to neutralise “NUL characters or null bytes when they are sent to a downstream component”, with the consequence that “an injected NUL character or null byte may cause the product to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted”, which “could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms” [9].

The practical lesson for anyone writing a detection or a filter is that a check applied to the whole string and a check applied by a downstream component that stops at the first null are not the same check. A traversal rule that inspects the full parameter can pass input that the file-handling layer reads differently.

The part that matters most

File write on an appliance is serious on its own. What raises this case above a routine critical advisory is the post-exploitation behaviour Fortinet documents in its own indicators of compromise. Alongside planted and modified files and root cron entries referencing the administrative path, the advisory records an unauthorised archive account configuration pointing at attacker infrastructure [1].

Independent reporting states the specific shape: log entries showing an archive account configured to send archived mail to an external address at 79.141.169.187, with a destination directory [5][7]. Beazley Security describes the same pattern as attackers “implanting persistent code and reconfiguring mail archiving to send copies of messages to attacker infrastructure” [3].

This is the finding to act on. Archiving is a supported feature of the product, configured through the normal interface and stored in the appliance configuration. It is not malware, it will not be flagged by a file-integrity scan, and it is carried forward by a configuration backup and restore. An organisation that installs the fixed firmware when it ships, without auditing archive and forwarding configuration, will have a patched appliance that is still copying its mail to someone else.

Where the reporting diverges

Two divergences should be published rather than smoothed over. The first is the catalogue date. Help Net Security and Beazley Security both record the flaw being added to the US exploited-vulnerability catalogue on 1 October [3][4]. SecurityWeek dates the addition to 2 October and states that federal agencies must act “within three days” under the relevant binding directive [6]. BleepingComputer reports a deadline of 4 October [5]. A write-up published on 2 October stated the flaw was not then listed at all [7]. These cannot all be right; an operator who needs the date for a compliance record should read the catalogue itself.

The second is exposure. The same write-up asserts that “Shodan and Censys search data show thousands of” internet-facing instances while giving no number, no date and no query [7]. That figure is now circulating. It is unverified here, and scoping decisions should be based on an organisation’s own inventory of appliances with the encryption service enabled, not on it.

What to do

  • Decide explicitly whether to disable Identity Based Encryption or restrict the interface, and record who accepted the loss of external secure delivery [1][2][10].
  • Audit archive, forwarding and relay configuration on every FortiMail appliance now, before any upgrade, and compare it against a known-good baseline rather than against the current running state [1][3].
  • Treat a configuration restore as a reinfection risk: a backup taken after compromise carries the archive account with it [1][5].
  • Check Fortinet’s indicators against the appliance file system and system event log, including the planted and modified files and root cron entries referencing the administrative path [1][7].
  • Confirm the catalogue entry and any deadline from the source catalogue, not from reporting about it [3][4][6][7].
  • If you run 7.2.x, plan the migration to a supported branch now; no fix is offered for that branch [1].

The pattern here is one worth carrying into the next advisory of this class. The vulnerability is in a feature whose whole purpose is to be reachable by people outside the organisation, the mitigation withdraws that feature, the fix did not exist on the day of disclosure, and the attacker’s objective was not code on the box but a supported configuration setting that quietly duplicates mail. None of those four facts is addressed by waiting for firmware.

Sources

Every R3KONX article cites its primary material. 10 sources, in order of first citation. Links open the original publication.

  1. FG-IR-26-175: Improper Limitation of a Pathname to a Restricted Directory (CVE-2026-104286) Fortinet PSIRT · 2026-10-01
  2. Fortinet FortiMail FAQ: CVE-2026-104286 watchTowr · 2026-10-02
  3. Critical Path Traversal in Fortinet FortiMail Under Active Exploitation (CVE-2026-104286) Beazley Security · 2026-10-02
  4. Critical FortiMail zero-day exploited in the wild (CVE-2026-104286) Help Net Security · 2026-10-02
  5. Fortinet warns of critical FortiMail flaw exploited in zero-day attacks BleepingComputer · 2026-10-01
  6. Exploited Fortinet FortiMail Zero-Day Calls for Urgent Action SecurityWeek · 2026-10-02
  7. CVE-2026-104286: FortiMail Zero-Day Actively Exploited The Cybersec Guru · 2026-10-02
  8. CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') MITRE · 2026-10-04
  9. CWE-158: Improper Neutralization of Null Byte or NUL Character MITRE · 2026-10-04
  10. Configuring IBE encryption, FortiMail 8.0.0 Administration Guide Fortinet Document Library · 2026-10-04

Researched and written by the R3KONX analysis desk from the cited primary material. Version, indicator and workaround detail is taken from Fortinet's advisory and verified against independent reporting of it; no exploitation detail is reproduced. Reporting diverges on the catalogue date and the federal deadline, and both readings are published rather than resolved. The internet-exposure figure in circulation is unsourced and is labelled as such. Corrections to event@r3konx.asia.

R3KONX 2027

Work in this domain? So does the programme

4–6 May 2027, World Trade Centre Kuala Lumpur. Curated talks, hands-on training and The BattleGrid.