Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2023-27997: Pre-authentication RCE in Fortinet FortiOS and FortiProxy SSL-VPN

Published Jun 13, 2023 · Updated 3 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days8 mentions · peak 6 in a dayToday
CVSS9.8Critical · v3.1
EPSS13.8%97th percentile
CISA KEVYesAdded Jun 13, 2023
In the wildActivePer CISA KEV
Vendor
Fortinet
IdentifiersCVE-2023-27997CWE-122 · Heap-based Buffer Overflow
Also known asxortigate

CVE-2023-27997 is a heap-based buffer overflow in the SSL-VPN functionality of Fortinet FortiOS and FortiProxy. A remote, unauthenticated attacker can trigger the flaw using specially crafted requests and potentially execute arbitrary code or commands on the affected appliance. Identified affected branches include FortiOS 7.2.4 and earlier, 7.0.11 and earlier, 6.4.12 and earlier, and 6.0.16 and earlier; FortiProxy 7.2.3 and earlier, 7.0.9 and earlier, 2.0.12 and earlier, and all 1.1 and 1.2 releases. FortiOS 7.4 is listed as unaffected. The vulnerability has been exploited in the wild, including before patches became available.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation permits unauthorized code or command execution before authentication, compromising the appliance independently of VPN credentials or MFA. Appliance compromise can enable access to sensitive configurations, credentials and cryptographic material, installation of persistent access mechanisms, and subsequent movement into connected networks. Post-exploitation activity associated with this and other FortiGate vulnerabilities has included malicious symbolic links providing read-only access to device files even after vulnerability patches were applied.

Mitigation

If you can’t patch tonight, do this now.

Disable SSL-VPN until fixed firmware can be installed. Restrict network reachability to the affected service as an additional exposure-reduction measure. MFA does not prevent exploitation because the vulnerability is reachable before authentication.

Remediation

Patch, then assume compromise.

Upgrade affected FortiOS, FortiOS-6K7K and FortiProxy installations to fixed releases specified in Fortinet advisory FG-IR-23-097 or later supported releases, following Fortinet's recommended upgrade path. FortiProxy 1.1 and 1.2 installations must migrate to a fixed release. Investigate previously exposed appliances for compromise: patching does not remove every possible persistence mechanism or invalidate stolen secrets. For confirmed compromise, isolate the appliance, preserve forensic evidence, restore device integrity, rotate configured and potentially exposed authentication secrets and certificates, and investigate connected systems for lateral movement.

Public exploits

Exploits

3 exploits validated by Mallory's analysis. Hidden: 7 rejected by Mallory's analysis as not a working exploit.

View more in app →
Fortigate-SSL-VPN-Exploit-KitThis is a 100-file exploit catalog rather than a detection-only repository: the supplied structure contains README.md, .gitignore, and 98 standalone Python clients in exp/. Filenames encode a FortiGate appliance SKU and exact FortiOS build, spanning models such as 30E through 3000D and firmware trains from 6.0 through 7.4. The critical asset is the per-image offset/gadget matrix: every client hardcodes build-specific stack layouts, BSS/GOT/function addresses, ROP gadgets, object sizes, and spray parameters. The code implements two unauthenticated SSL-VPN RCE families identified in the README as CVE-2024-21762 and CVE-2023-27997. CVE-2024-21762-style clients issue malformed chunked POST requests to /aaaa/bbbb while spraying /remote/error or /remote/hostcheck_validate. They corrupt request-processing state, redirect control flow through per-build ROP chains, and invoke FortiGate's internal execute_cmd routine. CVE-2023-27997-style clients first obtain a dynamic salt from /remote/info, reproduce the MD5/XOR enc= encoding, calculate seeds for controlled byte writes, spray SSL-related objects, and overwrite an indirect target/GOT entry to execute attacker-controlled commands. Payload delivery has three observed forms: direct Node.js HTTP retrieval and eval of a configurable /s.js URL; TFTP retrieval of s.js into /tmp/s followed by Node execution; and x86-64/ARM raw-payload stagers. The latter obtain a length-prefixed second stage from a configurable TCP service, allocate executable memory, execute the received bytes, and make a second configurable TCP callback that functions as a reverse shell channel. TLS certificate verification is disabled throughout. Many clients repeatedly attack in parallel, with hardcoded CPU/thread counts and high connection/spray volumes, indicating reliability tuning rather than a minimal PoC. No fixed victim IP, domain, or attacker infrastructure is embedded. Target and callback hosts/ports are command-line supplied, so the fingerprintable observables are primarily the SSL-VPN paths, malformed chunked-transfer patterns, unusually large form/hostcheck requests, the FortiSSLVPN user agent, requests to /remote/info, and outbound target traffic to operator-selected HTTP, TFTP, or raw TCP services. README references additional launcher, listener, shellcode, and JavaScript files, but those are not present in the supplied file listing; conclusions about their contents are therefore limited to the README's description.abraxas · Disclosed Sep 1, 2026 · python · assembly · network · webOperationalxortigate-cve-2023-27997This repository contains a proof-of-concept (POC) exploit for CVE-2023-27997, a critical remote code execution vulnerability in Fortinet FortiGate SSL VPN devices. The main file, 'exploit.py', is a heavily commented Python script that demonstrates the exploitation process, including buffer overflow and ROP chain construction, but does not provide a fully weaponized payload. The exploit requires the attacker to specify the target (host:port) and a local callback address. It uses custom SSL/TLS connections and crafts HTTP(S) requests to the '/remote/error' endpoint on the target device. The script is intended for educational purposes and does not include fingerprinting or vulnerability checks. The README.md provides a brief overview and points to a detailed blog post for further information. The exploit demonstrates the attack vector and methodology but is not directly usable for real-world attacks without further development.lexfo · Disclosed Oct 12, 2023 · python · networkPoCfgt-cve-2023-27997-exploitThis repository provides a Python proof-of-concept exploit for CVE-2023-27997, a critical heap-based buffer overflow vulnerability in Fortinet FortiGate SSL-VPN (FortiOS) devices. The exploit consists of a single main script ('fgt-cve-2023-27997-exploit.py'), a README.md with detailed usage and technical background, and a requirements.txt listing dependencies (requests, urllib3, numpy, scipy). The exploit works by first retrieving a 'salt' value from the target's '/remote/info' endpoint, then crafting a ROP chain payload (demonstrated with a ping command), encrypting it, and sending it to the vulnerable '/remote/hostcheck_validate' endpoint as the 'enc' parameter. The script is designed for authorized testing and demonstrates remote code execution (RCE) without authentication. The README provides affected version ranges for FortiOS and FortiProxy, usage instructions, and technical details about the vulnerability and exploit chain. The attack vector is network-based, targeting the SSL-VPN web interface. The exploit is a PoC and requires the attacker to specify the target IP and port.onurkerembozkurt · Disclosed Apr 18, 2025 · python · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
FortinetFortiosoperating_system
FortinetFortios-6k7kapplication
FortinetFortiproxyapplication
FAQ

Frequently asked questions

Is CVE-2023-27997 exploited in the wild?
Yes. As of Nov 25, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Jun 13, 2023.
Is there a public exploit for CVE-2023-27997?
Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2023-27997, the earliest disclosed Oct 12, 2023.
Is there a patch for CVE-2023-27997?
Upgrade affected FortiOS, FortiOS-6K7K and FortiProxy installations to fixed releases specified in Fortinet advisory FG-IR-23-097 or later supported releases, following Fortinet's recommended upgrade path. FortiProxy 1.1 and 1.2 installations must migrate to a fixed release.
What products are affected by CVE-2023-27997?
Fortinet Fortios, Fortinet Fortiproxy, and Fortinet Fortios-6k7k.
How severe is CVE-2023-27997?
CVE-2023-27997 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 13.8% (97th percentile) as of Nov 25, 2026.
Activity feed

Recent activity

69 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
huntio blogNews · Nov 25, 2026US hospital credentials taken, a US manufacturer’s cloud accessed, law firms and federal agencies nextMentioned only to clarify that it was removed from an earlier draft because it does not appear in the recovered files. No technical details or operational association are established.Read more ↗vulncheck blogNews · Nov 16, 2026Identifying FortiGate Firmware From a Single ClientHello | Blog | VulnCheckListed as a known-exploited FortiOS vulnerability affecting anchor versions for generations 2 and 3. The article cautions that omitted end-of-life branches in CPE ranges can understate exposure; omission of FortiOS 5.4.0 is not evidence of safety.Read more ↗zeropath blogNews · Nov 11, 2026Brief Summary: FortiAuthenticator CVE-2026-126251, an API Incorrect Authorization Flaw Enabling Authentication Bypass - ZeroPath Blog | ZeroPathA previously exploited FortiGate vulnerability cited as historical background. The described incident involved a malicious file permitting read-only access to device files. It is separate from the FortiAuthenticator issue.Read more ↗zeropath blogNews · Nov 11, 2026Brief Summary: FortiOS and FortiPAM CVE-2026-126255 SSH Authentication Bypass via Path Traversal - ZeroPath Blog | ZeroPathA previously exploited vulnerability in Fortinet FortiGate products, mentioned as historical context. The associated historical activity involved malicious symbolic links that could preserve filesystem read access after upgrades fixed the entry vulnerabilities. Fortinet published detection and removal measures. The content does not describe this CVE's underlying mechanism.Read more ↗
+52 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence20Every report linking this CVE to a named adversary.
Associated malware16Malware families linked to this CVE, with evidence and IOCs.
Detection signatures8YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity2Community discussion across Reddit, Mastodon, and other social sources.