Skip to main content
Mallory
CriticalCISA KEVExploited in the wildPublic exploit

Authentication Bypass in Fortinet FortiOS, FortiProxy, and FortiSwitchManager Administrative Interface

IdentifiersCVE-2022-40684CWE-288

CVE-2022-40684 is a critical authentication bypass vulnerability affecting the administrative HTTP/HTTPS interface of Fortinet FortiOS, FortiProxy, and FortiSwitchManager. Affected versions include FortiOS 7.2.0 through 7.2.1 and 7.0.0 through 7.0.6, FortiProxy 7.2.0 and 7.0.0 through 7.0.6, and FortiSwitchManager 7.2.0 and 7.0.0. The flaw is classified as an authentication bypass using an alternate path or channel and can be triggered by specially crafted HTTP or HTTPS requests to the management interface. The provided content indicates exploitation is associated with improperly validated or overly trusted HTTP headers, and multiple exploit variants exist, including one using a User-Agent value of "Node.js." Successful exploitation allows an unauthenticated remote attacker to perform administrative operations through the web management interface.

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 grant an unauthenticated attacker super-admin or equivalent administrative control over a vulnerable appliance. The attacker can perform broad administrative actions including changing network configurations, creating new administrator or local user accounts, downloading device configuration data, and initiating packet captures. The content also notes observed post-exploitation activity including installation of malicious administrator accounts such as "fortigate-tech-support." Because the flaw affects the management plane, impact spans confidentiality, integrity, and availability and can enable follow-on compromise, persistence, and use of the device as an initial access point into the broader environment.

Mitigation

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

If immediate patching is not possible, restrict or remove exposure of the administrative interface from untrusted networks, especially the WAN/Internet. Disable WAN access to the management interface and use VPN-based or out-of-band management instead. Increase monitoring of HTTP/HTTPS access to the management interface for suspicious crafted requests and anomalous headers, and review logs for signs of exploitation or unauthorized administrative changes. Because patching does not remediate prior compromise, perform a proactive threat assessment even after mitigation or upgrade.

Remediation

Patch, then assume compromise.

Upgrade affected products to fixed versions immediately. The content states Fortinet recommends upgrading FortiOS to 7.0.7 or 7.2.2, and FortiProxy to 7.0.7 or 7.2.1; Fortinet also issued PSIRT guidance and workarounds under advisory FG-IR-22-377. Organizations should not stop at patching: they should validate device configurations for unauthorized changes, review for unknown administrator accounts, inspect for evidence of configuration theft or other compromise, and rotate credentials if compromise is suspected. If running affected FortiSwitchManager versions, apply the vendor-provided fixed release referenced in Fortinet’s advisory.
PUBLIC EXPLOITS

Exploits

11 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (7 hidden).

VALID 11 / 18 TOTALView more in app
fortigate-cve-2022-40684-toolMaturityPoCVerified exploit

This repository is a small standalone Python exploit/assessment tool for CVE-2022-40684 affecting Fortinet FortiGate/FortiOS devices. The repository contains one primary code file (fortigate_tool.py), a README, dependency list, license, and .gitignore. The script is the clear entry point and uses requests, urllib3, argparse, json, os, and prettytable. Core exploit logic: the tool sends HTTPS requests to FortiGate CMDB API endpoints while setting crafted headers (Forwarded and X-Forwarded-For with 127.0.0.1, plus User-Agent: Report Runner). This is consistent with public exploitation patterns for CVE-2022-40684 authentication bypass. TLS verification is disabled. The script first checks likely vulnerability by requesting /api/v2/cmdb/system/admin and treating HTTP 200 with a results field as success. Capabilities implemented: - Vulnerability validation against /api/v2/cmdb/system/admin - Enumeration of admin users, local users, and user groups - Arbitrary endpoint dumping via --dump - Bulk configuration extraction via --dump-all from multiple sensitive CMDB endpoints - Unauthorized privileged account creation via POST to /api/v2/cmdb/system/admin with accprofile set to super_admin The dump-all feature targets numerous high-value configuration areas including system settings, interfaces, zones, local/LDAP/RADIUS users, firewall objects and policies, VPN settings, routes, and logging configuration. Responses are written locally under fortigate_dump/ as JSON or raw text. This is not merely a detector: it includes active post-bypass actions and a write capability (admin creation), making it a real exploit tool rather than a simple scanner. It is operational but not highly modular or framework-based; payloads and behavior are hardcoded and driven by command-line flags.

pintukumar-sutradharDisclosed Apr 1, 2026pythontextnetworkweb
CVE-2022-40684MaturityPoCVerified exploit

This repository provides a proof-of-concept (PoC) exploit for CVE-2022-40684, a critical authentication bypass vulnerability affecting Fortinet FortiOS, FortiProxy, and FortiSwitchManager. The repository contains a Python script (exploit.py) that sends specially crafted HTTP GET requests to the target's administrative API endpoints, using specific headers to exploit the authentication bypass. If the target is vulnerable, the script extracts and displays admin usernames, access levels, device serial number, version, and LDAP configuration details. The repository also includes a Nuclei YAML template (CVE-2022-40684.yaml) for automated vulnerability scanning, a README with usage instructions, and some update log files. The exploit is read-only and does not modify the target, focusing on information disclosure. The main attack vector is network-based, targeting the administrative web interface of Fortinet devices.

ccordeiroDisclosed Nov 19, 2025pythonyamlnetwork
fortipwnMaturityPoCVerified exploit

This repository is a Rust-based exploit tool targeting Fortinet FortiOS devices vulnerable to CVE-2022-40684. The exploit works by sending a crafted HTTPS PUT request to the FortiOS management API endpoint (/api/v2/cmdb/system/admin/admin) with custom headers and a JSON body containing the attacker's SSH public key. If the target is vulnerable, the key is added to the admin account's authorized_keys, granting the attacker SSH access as admin. The tool takes a list of target IP addresses and a public key file as input, attempts the exploit in parallel across all targets, and reports which hosts were successfully compromised. The codebase is structured with a main entry point (src/main.rs), the core exploit logic (src/cve.rs), and a test harness (tests/integration_test.rs). No hardcoded credentials or fake payloads are present; the exploit is operational and automates a real-world attack scenario.

xtwipDisclosed Oct 16, 2022rustnetwork
CVE-2022-40684-POCMaturityPoCVerified exploit

This repository contains a Python proof-of-concept exploit for CVE-2022-40684, an authentication bypass vulnerability affecting Fortinet FortiProxy and FortiOS devices. The main script, 'CVE-2022-40684.py', automates the exploitation process by reading a list of target URLs, usernames, and an attacker's SSH public key from files. For each target and username, it sends a crafted HTTP PUT request to the '/api/v2/cmdb/system/admin/<username>' endpoint, attempting to inject the attacker's SSH public key into the admin account. If successful, this grants the attacker SSH access to the device. The exploit requires network access to the vulnerable device's API and is operational, as it performs the actual key injection. The repository also includes a README with usage instructions and a LICENSE file.

kljunowskyDisclosed Oct 13, 2022pythonnetwork
CVE-2022-40684MaturityPoCVerified exploit

This repository is a proof-of-concept exploit for CVE-2022-40684, a critical authentication bypass vulnerability affecting Fortinet FortiOS, FortiProxy, and FortiSwitchManager appliances. The main exploit script (exploit.py) allows an attacker to add their SSH public key to the admin user (or another specified user) on a vulnerable device by abusing an unauthenticated REST API endpoint. The script supports both single-target and mass exploitation (via a list of targets), and can provide an interactive SSH shell if the key is successfully injected. The exploit works by sending a crafted HTTP PUT request to the /api/v2/cmdb/system/admin/{username} endpoint with a JSON payload containing the attacker's SSH key. If successful, the attacker gains SSH access to the device. The repository also includes a parser script (parser_zoomeye.py) for processing Zoomeye search results, and a requirements.txt file listing dependencies (paramiko, requests, rich). The README provides detailed usage instructions, affected product versions, and mitigation advice. The exploit is operational and provides real post-exploitation access, but is not part of a larger framework.

HAWA771Disclosed Oct 15, 2022pythonnetwork
CVE-2022-40684MaturityPoCVerified exploit

This repository contains an exploit for CVE-2022-40684, a critical authentication bypass vulnerability affecting Fortinet FortiGate devices. The main file, exp.py, is a Python script that allows an attacker to upload their own SSH public key to the admin account of a vulnerable device by sending a crafted HTTP PUT request to the /api/v2/cmdb/system/admin/admin endpoint. The script supports both single-target and batch exploitation modes, reading targets from a file if specified. After attempting the exploit, it checks if the SSH port (22) is open, indicating successful key upload and potential SSH access. The README provides usage instructions and context for identifying FortiGate devices. The exploit is operational, requiring a valid SSH public key and access to the vulnerable API endpoint.

qingsiweisanDisclosed Oct 26, 2022pythonnetwork
CVE-2022-40684-metasploit-scannerMaturityPoCFrameworkmetasploitVerified exploit

This repository contains a Metasploit auxiliary scanner module (fortinet_product_auth_bypass.py) targeting CVE-2022-40684, an authentication bypass vulnerability in several Fortinet products (FortiOS, FortiProxy, FortiSwitchManager). The exploit is written in Python and designed to be used within the Metasploit framework. It works by sending specially crafted HTTP(S) requests with manipulated headers to administrative API endpoints, bypassing authentication controls. Upon successful exploitation, it enumerates admin users, retrieves product serial and version information, and attempts to leak LDAP configuration from the target device. The module is operational and provides actionable results for penetration testers and defenders. The README provides clear setup and usage instructions, and the code is structured for integration with Metasploit's scanner modules.

TaroballzChenDisclosed Oct 27, 2022pythonnetwork
CVE-2022-40684MaturityPoCVerified exploit

This repository provides a working exploit and detection script for CVE-2022-40684, a critical authentication bypass vulnerability in Fortinet FortiOS, FortiProxy, and FortiSwitchManager appliances. The main exploit (exploit.py) is a Python script that allows an attacker to inject their SSH public key into the admin account (or another specified user) on a vulnerable device by sending a crafted HTTP PUT request to the /api/v2/cmdb/system/admin/{username} endpoint. If successful, the script then attempts to connect via SSH using the injected key, providing an interactive shell to the attacker. The script supports both single-target and mass exploitation modes, with multithreading for efficiency. The repository also includes a Nmap NSE script (cve-2022-40684.nse) for detection, a simple parser for Zoomeye search results, and a requirements.txt for dependencies. The exploit is operational and provides real post-exploitation access if the target is vulnerable. No hardcoded payloads are present; the attacker's own SSH key is used. The main attack vector is network-based, targeting the HTTP management interface of the affected Fortinet products.

ChocapikkDisclosed Oct 15, 2022pythonluanetwork
Fortinet-PoC-Auth-BypassMaturityPoCVerified exploit

This repository contains a Bash proof-of-concept exploit for CVE-2022-40684, an authentication bypass vulnerability affecting Fortinet devices (such as FortiGate). The repository consists of a README.md with usage instructions and a single exploit script, poc.sh. The script takes a target IP and port as arguments, then sends a specially crafted HTTPS GET request to the /api/v2/cmdb/system/admin endpoint on the target device, using specific HTTP headers to exploit the authentication bypass. If successful, it dumps the system admin information to a file named after the target IP. The exploit demonstrates the vulnerability and provides a clear indication of whether the target is affected. The code is a straightforward PoC and does not provide weaponized or post-exploitation capabilities.

FiliplainDisclosed Oct 13, 2022bashnetwork
CVE-2022-40684MaturityPoCFrameworknucleiVerified exploit

This repository provides a proof-of-concept (PoC) exploit for CVE-2022-40684, a critical authentication bypass vulnerability affecting Fortinet FortiOS, FortiProxy, and FortiSwitchManager. The repository contains three files: a Python exploit script (exploit.py), a Nuclei template (CVE-2022-40684.yaml), and a README.md with usage instructions. The exploit works by sending specially crafted HTTP GET requests with specific headers to the administrative API endpoints of the target device, bypassing authentication and extracting sensitive information such as admin usernames, access levels, device serial and version, and LDAP configuration. The Nuclei template allows for automated detection of the vulnerability. The exploit is read-only and does not modify device state. The main attack vector is network-based, targeting exposed administrative interfaces. No hardcoded IPs or domains are present; the target is user-supplied.

carlosevieiraDisclosed Oct 13, 2022pythonyamlnetwork
CVE-2022-40684MaturityPoCVerified exploit

This repository contains a proof-of-concept (POC) exploit for CVE-2022-40684, an authentication bypass vulnerability affecting Fortinet FortiOS, FortiProxy, and FortiSwitchManager appliances. The main file, CVE-2022-40684.py, is a Python script that allows an attacker to add their own SSH public key to a specified user account on a vulnerable device by sending a crafted HTTP PUT request to the device's API endpoint. The script requires the target's IP address, a valid username, and a path to the attacker's SSH public key file. If successful, the attacker can then SSH into the device as the specified user. The repository also includes a README.md with technical analysis, usage instructions, and mitigation advice. The exploit is network-based, targeting the device's HTTPS API interface, and is a functional POC that demonstrates the vulnerability's impact.

horizon3aiDisclosed Oct 13, 2022pythonmarkdownnetwork
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
FortinetFortiswitchmanagerapplication

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 evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware2

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 activity2

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