CVE-2023-27997: Fortinet FortiGate SSL-VPN Heap Overflow Zero-Day Explained and Fixed
A CVSS 9.8 pre-authentication heap overflow in Fortinet FortiOS SSL-VPN exploited as a zero-day. Nation-state actors including Volt Typhoon used related Fortinet vulnerabilities for long-term persistence in US critical infrastructure. Every FortiGate with SSL-VPN enabled is a target.
CVE-2023-27997 is a pre-authentication heap buffer overflow in the Fortinet FortiOS SSL-VPN web portal, enabling unauthenticated remote code execution on FortiGate VPN appliances. Disclosed June 12, 2023, with a CVSS score of 9.8, it was exploited in the wild before Fortinet published its advisory — making it a confirmed zero-day. Fortinet stated exploitation occurred in a limited number of cases, consistent with targeted nation-state use rather than immediate mass exploitation.
CISA's Advisory AA23-144A linked FortiGate exploitation to Volt Typhoon, a Chinese state-sponsored threat actor focused on pre-positioning within US critical infrastructure — utilities, communications, transportation, and government systems — for potential disruption capability. The advisory identified Fortinet appliances as one of Volt Typhoon's primary initial access vectors. FortiGate SSL-VPN appliances sit at the network perimeter of hundreds of thousands of organizations worldwide, making every unpatched internet-facing instance a potential target.
How the Heap Overflow Works in FortiOS SSL-VPN
The Fortinet FortiOS SSL-VPN web portal processes HTTP and HTTPS requests for user authentication and session management. The heap buffer overflow vulnerability exists in the SSL-VPN authentication code path — specifically in how certain pre-authentication HTTP request fields are parsed and copied into heap-allocated buffers.
An unauthenticated attacker sends a crafted HTTP request to the FortiGate SSL-VPN portal's HTTPS listener. A field in the request exceeds the expected maximum length for the corresponding heap-allocated receive buffer. FortiOS copies the field content into the buffer without adequate bounds checking, overflowing into adjacent heap memory. Through controlled heap layout, the attacker corrupts heap management structures or function pointers in adjacent allocations, redirecting execution to attacker-controlled shellcode or ROP chains. Because the SSL-VPN portal runs with elevated privileges on FortiOS — the embedded Linux-based operating system — the resulting code execution is privileged, providing root access to the FortiGate appliance.
Identify FortiGate appliances with SSL-VPN enabled
Scan for Fortinet FortiGate SSL-VPN web portals. The login page has distinctive Fortinet branding. Internet-facing FortiGate appliances are indexed by Shodan and Censys. Only appliances with SSL-VPN web portal enabled are vulnerable.
Send heap overflow request to SSL-VPN portal
Send a crafted unauthenticated HTTPS request to the FortiGate SSL-VPN portal with an oversized field value that triggers the heap buffer overflow in the authentication processing code.
Control execution via corrupted heap
The overflow corrupts adjacent heap memory in a controlled way, redirecting the vulnerable code path to execute attacker-provided shellcode or exploit a return-oriented programming chain within the FortiOS process.
Establish persistent access
With root access to the FortiGate, create new VPN user accounts, install implants in the FortiOS filesystem, or modify SSL-VPN policy to allow attacker-controlled certificates — establishing persistence that survives firmware restarts.
Pivot into the internal network
Use the compromised VPN gateway to access all internal network segments the SSL-VPN is configured to route — equivalent to having a legitimate VPN connection with the maximum permitted access level.
Volt Typhoon and Critical Infrastructure Targeting
CISA Advisory AA23-144A (updated) identified Chinese state-sponsored actor Volt Typhoon (also tracked as Bronze Silhouette) as targeting US critical infrastructure organizations using Fortinet appliances as initial access vectors. The targeting was not financially motivated — Volt Typhoon's goal was pre-positioning: establishing persistent, undetected access to critical infrastructure networks to enable potential disruption capability in future geopolitical crises.
Volt Typhoon's operational security was distinctive. They lived off the land — using built-in OS tools rather than custom malware, blending into normal network traffic, and maintaining access for months or years before detection. They specifically targeted VPN appliances as initial access precisely because VPN traffic is high-volume and difficult to baseline. CVE-2023-27997 fits this pattern: a pre-authentication vulnerability providing direct access to a device trusted to manage network perimeter security.
“Volt Typhoon actors are pre-positioning themselves on IT networks to enable lateral movement to OT assets to disrupt functions. The US authoring agencies are concerned about the potential for these actors to use network access for disruptive effects in the event of potential geopolitical tensions.”
— CISA Advisory AA23-144A, May 2023 (updated)
Patching and Fully Remediating CVE-2023-27997
Fortinet released patches June 12, 2023. The remediation for CVE-2023-27997 follows the same three-part framework as all Fortinet VPN vulnerabilities: patch, rotate credentials, investigate for compromise.
Upgrade FortiOS and FortiProxy to patched versions
FortiOS: 7.4.0, 7.2.5+, 7.0.12+, 6.4.13+, 6.2.14+. FortiProxy: 7.2.4+, 7.0.10+, 2.0.13+. For end-of-life 6.0.x versions: upgrade to a supported branch — no patches will be released for EOL. Verify running version via CLI: get system status | grep Version.
Disable SSL-VPN web portal if immediate patching is blocked
Via FortiOS CLI: config vpn ssl settings, set status disable. This eliminates the attack surface entirely at the cost of disrupting remote access. Use this as a bridge measure only — re-enable after applying the firmware upgrade.
Rotate all VPN credentials and certificates
Per the pattern established by CVE-2018-13379: patching stops future exploitation but does not invalidate credentials already extracted. Require all VPN users to change passwords. Revoke and reissue SSL certificates on the appliance.
Run Fortinet's published IOC detection
Fortinet published detection scripts and filesystem integrity checks in their PSIRT advisory. Run these against each appliance to identify artifacts from known exploitation toolkits. Also consult CISA AA23-144A for Volt Typhoon-specific indicators including behavioral patterns and network IOCs.
Investigate for persistent access mechanisms
Check the FortiOS filesystem for unexpected files, modified system binaries, or new VPN user accounts created via CLI rather than the management UI. Review outbound connection logs from the FortiGate for connections to external IPs not in the device's normal communication profile.
The bottom line
CVE-2023-27997 is the third major critical vulnerability class in Fortinet's SSL-VPN in five years — following the path traversal credential exposure of CVE-2018-13379 and the ongoing exploitation of those harvested credentials years later. The pattern should inform how organizations treat Fortinet VPN patching: not as a quarterly maintenance task but as an emergency response process, because the exploitation timeline for Fortinet SSL-VPN critical vulnerabilities is measured in days to weeks, not months.
The Volt Typhoon context adds a dimension beyond typical ransomware risk. Nation-state actors targeting critical infrastructure are not seeking immediate financial return — they are establishing persistent footholds for potential future use. The appropriate response to this threat model is not just patching the specific CVE but conducting a full compromise assessment of any FortiGate that has been internet-accessible with SSL-VPN enabled, auditing for long-dwell persistence mechanisms that may have been planted months before detection.
Frequently asked questions
What is CVE-2023-27997?
CVE-2023-27997 is a CVSS 9.8 pre-authentication heap buffer overflow in Fortinet FortiOS's SSL-VPN web portal. An unauthenticated attacker sends a crafted HTTP request that overflows a heap buffer in the SSL-VPN authentication code, enabling remote code execution on the FortiGate appliance without credentials.
Was CVE-2023-27997 a zero-day?
Yes. Fortinet confirmed the vulnerability was exploited in the wild before the June 12, 2023 advisory. CISA's advisory AA23-144A linked Fortinet VPN exploitation to Chinese state-sponsored actor Volt Typhoon, which targeted US critical infrastructure organizations for persistent access.
Which Fortinet products are affected?
FortiOS 6.0.x through 7.2.4 and FortiProxy versions 1.1.x through 7.2.3. Only devices with the SSL-VPN web portal enabled are exploitable via this vulnerability. FortiGate configured as a firewall without SSL-VPN is not affected by this specific attack vector.
How do I patch CVE-2023-27997?
Upgrade FortiOS to 7.4.0, 7.2.5+, 7.0.12+, 6.4.13+, or 6.2.14+. For FortiProxy: 7.2.4+, 7.0.10+, or 2.0.13+. For end-of-life 6.0.x: upgrade to a supported branch. As interim measure, disable SSL-VPN (set status disable) if immediate patching is blocked.
How does CVE-2023-27997 relate to previous Fortinet CVEs?
Fortinet FortiOS has experienced multiple critical VPN vulnerabilities. CVE-2018-13379 exposed credentials via path traversal (87,000 credentials published). CVE-2023-27997 is a distinct heap overflow class in the same SSL-VPN component. The pattern of repeated critical vulnerabilities in Fortinet's SSL-VPN is a reason CISA specifically named Fortinet appliances as priority targets in advisories about critical infrastructure security.
Sources & references
Get threat intel before your inbox does.
50,000+ security professionals read Decryption Digest for early warnings on zero-days, ransomware, and nation-state campaigns. Free, weekly, no spam.
Unsubscribe anytime. We never sell your data.

Founder & Cybersecurity Evangelist, Decryption Digest
Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals weekly.
