CVE-2025-25249
Fortinet Multiple Products Heap-based Buffer Overflow Vulnerability
Description
CVE-2025-25249 is a high-severity heap-based buffer overflow vulnerability in Fortinet FortiOS and FortiSwitchManager that allows an unauthenticated attacker to execute unauthorized code or commands via specially crafted packets. The flaw affects FortiOS 6.4 (all versions), 7.0.0 through 7.0.17, 7.2.0 through 7.2.11, 7.4.0 through 7.4.8 and 7.6.0 through 7.6.3, as well as FortiSwitchManager 7.0.0 through 7.0.5 and 7.2.0 through 7.2.6. Because FortiOS runs on FortiGate firewalls deployed at network perimeters, successful exploitation of this buffer overflow vulnerability hands an attacker control of the very device that enforces the network boundary. CVE-2025-25249 carries a CVSS score of 8.1, an EPSS score in the 83rd percentile, and is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
KEV Information
CVSS Score
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CalculatorCWEs
Affected Products
| Vendor | Product | Version |
|---|---|---|
| fortinet | fortios | >= 6.4.0, < 7.0.18; >= 7.2.0, < 7.2.12; >= 7.4.0, < 7.4.9; >= 7.6.0, < 7.6.4 |
| fortinet | fortiswitchmanager | >= 7.0.0, < 7.0.6; >= 7.2.0, < 7.2.7 |
| fortinet | fortisase | 25.1.39; 25.1.51 |
| siemens | ruggedcom ape1808 firmware | - |
Multiple CVSS Assessments
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://fortiguard.fortinet.com/psirt/FG-IR-25-084(Mitigation, Vendor Advisory)
- https://cert-portal.siemens.com/productcert/html/ssa-864900.html(Third Party Advisory)
- https://socradar.io/blog/cve-2025-25249-pivotc2-fortigate-rat/(Exploit, Third Party Advisory)
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-25249(US Government Resource)
Weakness Type
CWE-122: Heap-based Buffer Overflow
A heap-based buffer overflow occurs when a program writes more data into a dynamically allocated buffer than the allocation can hold, corrupting adjacent heap structures. In CVE-2025-25249 a specially crafted packet drives FortiOS to write past the end of a heap allocation, and the resulting corruption of heap metadata and neighbouring objects is what an attacker steers toward code execution.
Learn more: CWE-122 — Heap-based Buffer Overflow
CWE-787: Out-of-bounds Write
An out-of-bounds write is the general class in which software writes data outside the intended boundaries of a buffer, whether through an overflow, a bad index or faulty pointer arithmetic. In this Fortinet vulnerability the out-of-bounds write is the underlying primitive: the packet-parsing code does not validate the write boundary before copying attacker-controlled data, and the heap overflow is the concrete form that failure takes.
Learn more: CWE-787 — Out-of-bounds Write
Impact Analysis
CVE-2025-25249 is remotely exploitable over the network with no authentication and no user interaction, though its attack complexity is High — reliable exploitation depends on heap conditions the attacker does not fully control, which is why the score lands at 8.1 rather than 9.8. When exploitation succeeds the impact is high across confidentiality, integrity and availability: unauthorized code execution on a FortiGate or FortiSwitchManager means reading traffic and configuration, altering firewall and routing policy, and disabling the device entirely. A compromised perimeter firewall is also a durable position for onward intrusion, since it terminates VPN sessions and holds credentials for internal systems. The EPSS score of roughly 2.4% places it in the 83rd percentile, and CISA has confirmed active exploitation by adding CVE-2025-25249 to the KEV catalog with a 12 September 2026 deadline — public reporting even documents a FortiGate-specific remote access trojan built around this flaw.
Exploit Maturity
CISA has confirmed active exploitation of CVE-2025-25249 by adding it to the Known Exploited Vulnerabilities catalog with a 12 September 2026 remediation deadline. A third-party reference tagged as exploit material — SOCRadar's analysis of the PivotC2 FortiGate RAT — documents a remote access trojan built specifically around this FortiGate vulnerability, which means exploitation is not only proven but operationalised into attacker tooling. The EPSS score of about 2.4% places the vulnerability in the 83rd percentile, a strong statistical indicator of exploitation activity that aligns with the published reporting. The KEV ransomware flag is "Unknown", but given a working RAT and an internet-facing target class, every affected FortiOS and FortiSwitchManager device should be considered actively targeted.
Remediation
- Follow the CISA KEV required action. Apply mitigations in accordance with Fortinet's instructions, comply with CISA's BOD 26-04 "Prioritizing Security Updates Based on Risk" guidance and the "Forensics Triage Requirements", and discontinue use of the product if mitigations are unavailable. The KEV due date was 12 September 2026.
- Upgrade to a fixed FortiOS or FortiSwitchManager release. Fixed builds are FortiOS 7.0.18, 7.2.12, 7.4.9 and 7.6.4, and FortiSwitchManager 7.0.6 and 7.2.7; FortiOS 6.4 is affected in all versions and has no fixed build in that branch, so those devices must be migrated to a supported release. FortiSASE 25.1.39 and 25.1.51 and Siemens RUGGEDCOM APE1808 are also listed as affected — see Fortinet advisory FG-IR-25-084 and the Siemens ProductCERT advisory.
- Apply Fortinet's documented workaround where patching must wait. FG-IR-25-084 is tagged as carrying mitigation guidance; follow it to restrict or disable the affected interface handling until the upgrade window, and in the meantime limit which networks can send traffic to the vulnerable service.
- Hunt for compromise on affected devices. Review FortiOS configuration for unauthorised admin accounts, added SSL-VPN portals, modified firewall policies, unexpected scripts and automation stitches; check crash logs for repeated process restarts that indicate failed overflow attempts, and compare the running configuration against a trusted baseline. Public research describes a FortiGate RAT built on this vulnerability, so treat any anomaly as potential implant activity.
- Harden the perimeter long term by keeping management interfaces off the internet, restricting administrative access to a dedicated management network, rotating device credentials, VPN certificates and pre-shared keys after patching, and maintaining a supported FortiOS branch so that memory-safety fixes remain available.
Technical Details
CVE-2025-25249 is an out-of-bounds write (CWE-787) manifesting as a heap-based buffer overflow (CWE-122) in Fortinet FortiOS and FortiSwitchManager: a specially crafted packet reaches parsing code that copies attacker-controlled data into a heap allocation without validating that the write stays within the allocated size, so data spills into adjacent heap memory. Corrupting neighbouring allocations or heap metadata lets an attacker influence pointers and control-flow structures and ultimately execute unauthorized code or commands on the appliance. The CVSS vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H shows that the attack requires no privileges and no user interaction and is reachable over the network, but carries High attack complexity, reflecting that the attacker must win a race or achieve a specific heap layout for reliable exploitation rather than merely sending one packet. Since the reachable surface is packet parsing, exposure depends on which interfaces accept traffic for the affected service, which is why network restriction is an effective interim control.
Frequently Asked Questions
Is CVE-2025-25249 being actively exploited?
Yes. CISA added CVE-2025-25249 to its Known Exploited Vulnerabilities catalog with a remediation due date of 12 September 2026, and public security research documents a FortiGate-specific remote access trojan built around this vulnerability. With an EPSS score in the 83rd percentile, exploitation should be assumed to be ongoing.
What products are affected by CVE-2025-25249?
FortiOS is affected in 6.4 (all versions), 7.0.0–7.0.17, 7.2.0–7.2.11, 7.4.0–7.4.8 and 7.6.0–7.6.3, and FortiSwitchManager in 7.0.0–7.0.5 and 7.2.0–7.2.6. FortiSASE 25.1.39 and 25.1.51 and the Siemens RUGGEDCOM APE1808 firmware, which embeds the affected Fortinet software, are also listed as affected.
How do I fix CVE-2025-25249?
Upgrade to FortiOS 7.0.18, 7.2.12, 7.4.9 or 7.6.4, or FortiSwitchManager 7.0.6 or 7.2.7, as described in Fortinet advisory FG-IR-25-084. FortiOS 6.4 has no fix in-branch and must be migrated to a supported release; until patching completes, apply Fortinet's workaround and restrict which networks can reach the affected service.
How severe is CVE-2025-25249?
CVE-2025-25249 is rated High with a CVSS 3.1 base score of 8.1. It is unauthenticated and network-exploitable with no user interaction and results in high confidentiality, integrity and availability impact, but attack complexity is High because reliable heap exploitation requires specific conditions; the EPSS score in the 83rd percentile plus confirmed KEV-listed exploitation and a documented FortiGate RAT make it a priority patch nonetheless.
Need Help With Vulnerability Management?
Our security experts can help you prioritize and remediate vulnerabilities effectively.