Skip to main content
Meet us at Black Hat USA 2026— Las Vegas, August 1–6Book a Meeting
Mallory
CriticalCISA KEVExploited in the wildPublic exploit

FortiOS/FortiProxy SSL-VPN Heap-Based Buffer Overflow RCE

IdentifiersCVE-2022-42475CWE-122

CVE-2022-42475 is a heap-based buffer overflow in the SSL-VPN component (sslvpnd) of Fortinet FortiOS and FortiProxy. According to the provided content, affected versions are FortiOS SSL-VPN 7.2.0 through 7.2.2, 7.0.0 through 7.0.8, 6.4.0 through 6.4.10, 6.2.0 through 6.2.11, and 6.0.15 and earlier, as well as FortiProxy SSL-VPN 7.2.0 through 7.2.1 and 7.0.7 and earlier. A remote unauthenticated attacker can trigger the flaw by sending specifically crafted requests to the exposed SSL-VPN interface, causing heap memory corruption that may lead to arbitrary code or command execution on the appliance. The content also notes the vulnerability was observed exploited in the wild, including as a zero-day, against government and other high-value targets.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

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

Successful exploitation can result in remote code execution or arbitrary command execution on the affected Fortinet appliance without authentication. Because the vulnerable component is the SSL-VPN edge service, compromise can provide initial access at the network perimeter, enable deployment of malware or backdoors, theft of credentials and device configuration data, persistence on the firewall, and use of the appliance as a pivot point into internal networks. The content specifically associates exploitation with intrusions involving long-term access, malware deployment such as COATHANGER, and follow-on compromise of downstream systems.

Mitigation

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

If immediate patching is not possible, reduce exposure of the SSL-VPN interface to untrusted networks, restrict access with upstream filtering or allowlists where operationally feasible, and consider disabling SSL-VPN until fixes can be applied. Increase monitoring for crafted requests to SSL-VPN, anomalous administrative activity, unexpected outbound connections from the appliance, and evidence of persistence or malware on the device. The content also notes Fortinet released an IPS signature for proactive protection against exploitation of CVE-2022-42475.

Remediation

Patch, then assume compromise.

Upgrade affected FortiOS and FortiProxy versions to vendor-fixed releases referenced in Fortinet advisory FG-IR-22-398. Based on the provided content, organizations should patch all affected FortiOS and FortiProxy SSL-VPN deployments immediately and ensure unsupported branches are migrated to supported fixed versions. Because exploitation has been observed in the wild, remediation should also include incident response actions: review device configurations and logs, hunt for signs of compromise or persistence, rotate credentials that may have traversed or been stored on the device, and inspect for post-exploitation implants or unauthorized administrative changes.
PUBLIC EXPLOITS

Exploits

5 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 5 / 5 TOTALView more in app
CVE-2022-42475-POCMaturityPoCVerified exploit

Repository contains a Python exploit for CVE-2022-42475 (Fortinet FortiGate/FortiOS SSL-VPN pre-auth RCE) plus helper code and assembly shellcode. The main entry point is CVE-2022-42475.py, which builds a malicious HTTP request leveraging a Content-Length integer overflow (default set to 2^32+1) to trigger memory corruption in the SSL-VPN daemon (sslvpnd). It supports: (1) validate-only mode that attempts to crash/restart the service and heuristically reports vulnerability; (2) a simple callback mode that executes minimal shellcode which connects back and sends a marker string; and (3) a full exploit mode that uses a ROP chain to call functions like mprotect/calloc and AES routines, then runs shellcode that stages an AES-encrypted operator-supplied binary, writes it to /tmp/x, and execve()s it. The exploit can optionally route traffic through a local Burp proxy (127.0.0.1:8080) using an HTTP CONNECT tunnel. TLS is auto-enabled for common HTTPS ports (443/8443/10443) unless overridden. The ROP construction logic is encapsulated in foxrop.py (class ROP), which imports gadget/function addresses from an external JSON file (referenced in README as exploit_data.json). This repository is explicitly a redacted release: without the proprietary gadget/address data, full RCE is not directly usable across targets, though the structure clearly implements a real exploitation chain. Included shellcode sources: shellcode.s implements the full connect-back stager (socket/connect, hello byte exchange, receive size + encrypted payload, AES-CBC decrypt using imported function pointers, write to /tmp/x, then execve). shellcode_callback.s is a minimal proof-of-execution payload that connects back and writes a model/marker string (e.g., 'PWNED'). requirements.txt pins pycryptodome for AES operations used by the Python-side payload encryption and coordination.

ArthurHendrichDisclosed Feb 27, 2026pythonassemblynetwork
cve-2022-42475-FortinetMaturityPoCVerified exploit

This repository contains a proof-of-concept exploit for CVE-2022-42475, a heap overflow vulnerability in Fortinet's SSLVPN daemon. The main file, cve-2022-42475.py, is a Python script that constructs a ROP chain to exploit the vulnerability and achieve remote code execution. The exploit works by sending a specially crafted HTTP POST request to the /remote/error endpoint of the target Fortinet device over SSL. The payload triggers the heap overflow and executes a reverse shell, connecting back to the attacker's machine on port 31337. The attacker can specify arbitrary commands to be executed on the target. The repository is structured simply, with a README providing usage instructions and a single exploit script. The exploit requires the attacker to set up a listener to receive the reverse shell. No detection or scanning functionality is present; this is a direct exploit script.

Mustafa1986Disclosed Mar 22, 2023pythonnetwork
cve-2022-42475MaturityPoCVerified exploit

This repository contains a proof-of-concept (POC) exploit for CVE-2022-42475, a heap overflow vulnerability in Fortinet's SSLVPN daemon (FortiOS). The main file, 'cve-2022-42475.py', is a Python script that constructs a ROP chain to execute a reverse shell payload on the target system. The exploit connects to the target's SSLVPN service over SSL, sends a specially crafted HTTP POST request to the '/remote/error' endpoint with a large payload designed to trigger the heap overflow, and attempts to execute a reverse shell back to the attacker's machine on port 31337. The payload uses /bin/python to create a socket and spawn /bin/sh, passing attacker-supplied arguments. The exploit is version dependent, with hardcoded offsets and addresses that may require adjustment for different target systems. The repository also includes a README.md that describes the exploit's limitations and version dependency. No detection scripts or fake code are present; this is a real exploit POC targeting a specific vulnerability in Fortinet FortiOS.

scrtDisclosed Feb 23, 2023pythonnetwork
CVE-2022-42475MaturityPoCVerified exploit

This repository contains a working exploit for CVE-2022-42475, a pre-authentication remote code execution vulnerability in Fortinet FortiOS SSL VPN. The main exploit script (CVE-2022-42475.py) is a Python3 tool that can operate in several modes: vulnerability validation (crash detection), benign connect-back shellcode execution, and full payload delivery (implant deployment). The exploit leverages a buffer overflow in the SSL VPN webserver, using a custom ROP chain (constructed via foxrop.py and a required gadgets JSON file) to execute custom shellcode (provided in shellcode.s). The shellcode connects back to the attacker's machine, receives an encrypted payload (such as a Sliver implant), writes it to /tmp/x, and executes it. The exploit is operational but requires the operator to supply valid ROP gadget addresses for the target FortiOS version and hardware model. The README provides detailed usage instructions, requirements, and example output. The exploit targets FortiOS 6.0.4 on 100D hardware for full functionality, but the validation mode works across more versions. The main attack vector is network-based, targeting the SSL VPN web interface via a crafted HTTP POST request to /remote/logincheck. The repository includes Python code, an assembly shellcode file, and a requirements.txt for dependencies.

0xhaggisDisclosed Jun 21, 2023pythonassemblynetwork
cve-2022-42475MaturityPoCVerified exploit

This repository contains a proof-of-concept exploit for CVE-2022-42475, a heap buffer overflow vulnerability in Fortinet's FortiOS SSL-VPN daemon. The main exploit script, 'cve-2022-42475.py', is a Python script that constructs a ROP chain to execute a reverse shell payload. The exploit targets the '/remote/error' endpoint of the SSLVPN service over SSL, sending a specially crafted POST request with a large payload to trigger the vulnerability. The payload includes hardcoded memory offsets and gadgets, making it highly version dependent and likely requiring adjustment for different target systems. Upon successful exploitation, the script establishes a reverse shell from the target to the attacker's machine on port 31337, executing a user-supplied command. The repository also includes a README with usage instructions and a disclaimer. No detection scripts or fake code are present; this is a functional exploit with operational-level maturity.

Amir-hyDisclosed Mar 16, 2023pythonnetwork
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
FortinetFortiproxyapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

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, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence18

Every observed campaign linking this CVE to a named adversary.

Associated malware11

Malware families riding this exploit, with evidence and IOCs.

Detection signatures2

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity6

Community discussion across Reddit, Mastodon, and other social sources.