PEERSTITCH: What a FortiManager Compromise Leaves Behind After You Patch It

On October 14, 2026, Palo Alto’s Unit 42 published a report on a stealthy FortiGate implant it calls PEERSTITCH. The intrusion behind it began in September 2024 against a telecommunications managed service provider, tracked by Unit 42 as CL-STA-0954 (also UNC5820). Unit 42 says parts of the post-exploitation activity overlap with intrusions attributed to suspected nation-state actors, and stops short of naming one.

Two things make this worth reading closely. The attackers started at FortiManager, not at a firewall, and the implant they eventually used leaves nothing on disk. Both change what “I’ve patched it” means.

One caveat before the detail. This is a single vendor’s account of a single victim, and Unit 42 is a Palo Alto team writing about a competitor’s product. I found no independent analysis of the implant and no Fortinet statement on it. Where the report says it is uncertain, I say so below.

Update, October 18: CISA added CVE-2025-61624 to its Known Exploited Vulnerabilities catalog on October 16. Details are in the privilege escalation section below.

How it started: FortiManager

The initial access was CVE-2024-47575, the unauthenticated FortiManager flaw reached over the FGFM channel on TCP 541, scored 9.8 and publicly disclosed in October 2024. Unit 42 dates this intrusion to September 2024, so the exploitation predates that disclosure.

The attackers registered a rogue virtual FortiGate named localhost on the FortiManager and used that foothold to pull an archive off the box. According to Unit 42 it held configurations for more than 500 managed FortiGates, databases, a serial number and IP inventory, topology data, ciphertext credentials and trust material.

That archive is the real prize. FortiManager is the one place that knows how to reach every firewall it manages and holds what is needed to talk to them. I covered the trust model behind that in Wearing Someone Else’s Certificate, and the registration mechanics in NSE5 Part 5.

From there the attackers recovered administrator and SSL VPN passwords from the stolen ciphertext, which Unit 42 says they brute-forced, and opened VPN sessions into perimeter firewalls. They also pushed packet-capture configurations to downstream FortiGates covering unencrypted HTTP, TFTP, RADIUS and LDAP traffic. The report separately assesses, with medium confidence, that they pulled configurations from other firewalls by impersonating the management platform over FGFM. It says the evidence does not distinguish between the possible methods.

The privilege escalation: CVE-2025-61624

With valid administrator access in hand, the attackers needed root. They used CVE-2025-61624.

Fortinet’s advisory (FG-IR-26-122, published April 14, 2026) titles it “Path Traversal in CLI”. It is a CWE-22 flaw where an authenticated administrator with at least read-write permissions can write or delete arbitrary files through specific CLI commands. Fortinet scores it 6.0 (medium) with the vector AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H. NVD scores the same flaw 6.5, treating the attack vector as network rather than local. The advisory is marked “Known Exploited: Yes”, lists the attack as authenticated, and offers no workaround. A virtual patch exists in FMWP DB update 25.120.

On October 16, 2026, CISA added CVE-2025-61624 to its Known Exploited Vulnerabilities catalog, with a due date of October 19. The entry marks forensic triage as required under BOD 26-04 and lists use in ransomware campaigns as unknown. The deadline binds US federal agencies, but the requirement is worth borrowing: CISA is telling defenders that patching alone does not close this one, which is the argument of this post.

Unit 42 identifies the component it abused as the system.auto-script object. Fortinet’s advisory never uses the term auto-script, so I can’t confirm from the advisory alone that this is the same code path. The report describes the mechanism like this: the name given to an auto-script is not sanitised, so a name containing path traversal sequences places the script outside its intended directory. Once a file can be written to an arbitrary location with root privileges, running arbitrary code as root follows. The report says the attackers used traversal-style object names to drop their loader and to write a malicious Apache configuration. I’m leaving the exact object names and file paths out of this post. The class of bug is the useful part.

Affected FortiOS versions per Fortinet are 7.6.0 through 7.6.4 and 7.4.0 through 7.4.9, plus all versions of 7.2, 7.0 and 6.4. The fixed builds are 7.6.5 and 7.4.10 or later. For 7.2, 7.0 and 6.4 the advisory says to migrate to a fixed release and names no version. FortiPAM, FortiProxy and FortiSwitchManager are affected too, each with its own ranges. Check the advisory for your exact version, because NVD has revised the ranges since publication.

The score is the instructive part. A 6.0 does not read as urgent. In this chain it was the step that turned a stolen administrator login into root on the firewall, and the report does not date the exploitation of this step. It is the same pattern as CVE-2026-0322: PR:H looks reassuring until you remember who is holding credentials.

The implant

Unit 42 describes PEERSTITCH as a statically linked ARM64 Linux executable that runs once and exits. It attaches to two running FortiOS daemons, miglogd (logging) and iked (IKE and IPsec VPN), allocates a 16 KB read-write-execute memory region in each, and patches both in memory.

Three details matter for defenders:

  • No disk artefact. The report says it leaves no persistent binary on disk, opens no listening port and makes no outbound connection. A file scanner has nothing to find.
  • No network channel between the two halves. The two daemons pass data to each other through each other’s memory. The implant watches traffic already flowing through the processes, tags certain sessions, and iked later checks for those tags.
  • A VPN validation bypass. When iked handles a later session with a matching tag, it takes an alternate branch that bypasses default FortiOS security validations. Unit 42 does not say which validations are skipped or what access that grants.

The report also describes a second, separate foothold: an Apache mod_md ACME abuse that produced a recurring outbound SSH reverse shell. That means the memory-resident implant was one of several access paths, not the only one. Containing it without closing the others would leave the intruders in place.

Anti-forensics were thorough. The attackers killed the logging daemons, cleared crash logs, and deleted their own accounts, VPN groups and auto-script objects. Unit 42 suspects telemetry was also disrupted but says the available logs do not let it confirm how.

What the report does not establish

  • When the implant was deployed, and how many devices carry it. The report says only that the loader went to a select number of firewalls.
  • How the implant survives, or does not survive, a restart. The report doesn’t explain it, and I wouldn’t assume a reboot cleans a device.
  • Which client networks, if any, were actually entered. Unit 42 states it did not examine the networks behind the provider’s managed firewalls. The exposure it documents is of configuration and credential material.
  • Which of the FortiGateCloud-related CVEs, if any, were involved. The report excludes them because the affected firewalls had no such enrollment.

What I would do

  1. Patch FortiOS and FortiManager, and move off 7.2, 7.0 and 6.4 if you are on them. Those branches have no fixed build for CVE-2025-61624. CISA’s KEV entry also requires forensic triage, so treat patching as the first step and not the whole response.
  2. Treat everything FortiManager stores as exposed if it was ever compromised. Unit 42 says compromise does not end when the platform is patched, because stolen credentials and keys stay valid until rotated. That means administrator and SSL VPN credentials, certificates, private keys, and any RADIUS and LDAP bind secrets that crossed the sniffed links. Rotate after the host is verified clean or rebuilt, or the new secrets go straight to whoever is still on the box.
  3. Isolate the management plane. Restrict TCP 541 and management access to the addresses that need them. Unit 42 recommends treating edge management interfaces with the highest level of zero-trust isolation. I made the same argument from the build-standard side in The Golden Template Part 1.
  4. Audit device registrations and administrators. Look for unknown registered devices (a device called localhost is the one from this report), unexpected administrators, and changes to packet-capture settings.
  5. Review your auto-scripts. Check config system auto-script for any object name containing ../.
  6. Hunt inside the device, since a scanner won’t find this. Unit 42’s hunting guidance covers anonymous 16,384-byte read-write-execute regions in the miglogd and iked processes, patched instructions in their code, segmentation faults for those daemons in the crash logs, and cross-process writes to /proc/<pid>/mem. Most of that needs memory-inspection access that an administrator does not normally have, so involve Fortinet support if you suspect a device. Unit 42 publishes a YARA rule and the full indicator list in its report.
  7. Search for the network indicators. The report lists 23.240.77[.]233, 47.18.167[.]159, 45.32.41[.]202 and 198.199.122[.]22. Finding nothing does not clear a device, since the implant is memory-only and infrastructure changes.
  8. Keep independent logs. The attackers degraded local logging, so a copy held off the device may be the only reliable record. I wrote about the credential side of this in FortiBleed and its October update.

The lesson I take from this is narrow. A management platform that holds the keys to a fleet is a single point of compromise, and a patch applied afterward closes the door the attackers used without taking back what they walked out with.

Sources: Unit 42: PEERSTITCH report, FortiGuard PSIRT FG-IR-26-122 (CVE-2025-61624), NVD entry for CVE-2025-61624, CISA KEV catalog entry for CVE-2025-61624.