Skip to main content
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 Fortinet FortiOS and FortiProxy SSL-VPN components. According to the provided content, the flaw affects FortiOS 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 7.2.0 through 7.2.1 and 7.0.7 and earlier. A remote unauthenticated attacker can trigger the vulnerability by sending specifically crafted requests to the exposed SSL-VPN service, resulting in arbitrary code or command execution on the appliance. The content further states the vulnerability was observed exploited in the wild, including as a zero-day, and was used against government and government-related targets. Post-compromise reporting in the supplied material describes FortiOS-tailored implants and malware families such as BOLDMOVE and COATHANGER being deployed after exploitation.

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 lead to full remote compromise of the affected FortiGate/FortiProxy appliance without authentication. The provided content states attackers can achieve arbitrary code or command execution, obtain initial access, deploy malware, establish persistence, manipulate or evade logging, access device configurations and credentials, and use the firewall/VPN appliance as a foothold for lateral movement into internal networks. Reported victim impacts include compromise of government and critical infrastructure environments, data loss, OS/file corruption, credential theft, and long-term espionage persistence.

Mitigation

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

Where immediate patching is not possible, reduce exposure of the SSL-VPN interface, restrict access to trusted source IPs, and consider disabling SSL-VPN functionality until fixes are applied. Apply Fortinet IPS protections/signatures referenced in the content. Review logs, configurations, and filesystem artifacts for Fortinet-provided IoCs and signs of post-exploitation persistence. Reset credentials that may have been exposed through the appliance and investigate downstream/internal systems for lateral movement if the device was internet-exposed while vulnerable.

Remediation

Patch, then assume compromise.

Upgrade affected products to fixed releases identified in the provided content. For FortiOS, upgrade to 7.2.3 or later, 7.0.9 or later, 6.4.11 or later, 6.2.12 or later, and 6.0.16 or later. For FortiProxy, upgrade to 7.2.2 or later and 7.0.8 or later. The content also notes Fortinet published advisory FG-IR-22-398, released indicators of compromise, and provided IPS protections/signatures. If compromise is suspected, review Fortinet IoCs, audit device configuration and administrator accounts, inspect for persistence or malware artifacts, and rebuild/clean the appliance as appropriate rather than relying solely on patching.
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 evidence12

Every observed campaign linking this CVE to a named adversary.

Associated malware9

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.