Skip to main content
Mallory
CriticalPublic exploitVulnerability

CVE-2022-39952: Unauthenticated arbitrary file write and remote code execution in Fortinet FortiNAC

Published Feb 16, 2023 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS9.8Critical · v3.1
EPSS57.2%99th percentile
CISA KEVNoNot listed
In the wildReported550 exploitation records in Mallory
Vendor
Fortinet
IdentifiersCVE-2022-39952CWE-73 · External Control of File Name or…

CVE-2022-39952 is an external control of file name or path vulnerability in the Fortinet FortiNAC webserver's keyUpload scriptlet. An unauthenticated attacker can submit a specially crafted HTTP request to write arbitrary files on the system, potentially enabling unauthorized code or command execution. Affected versions include 9.4.0, 9.2.0–9.2.5, 9.1.0–9.1.7, 8.8.0–8.8.11, 8.7.0–8.7.6, 8.6.0–8.6.5, 8.5.0–8.5.4, and 8.3.7.

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 unauthenticated arbitrary file writes and can result in remote code or command execution and control of the affected FortiNAC system. Attackers can deploy web shells, schedule malicious tasks, and establish persistent command-and-control access. Exploitation has been observed in campaigns using compromised public-facing servers for initial access and subsequent lateral movement.

Mitigation

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

No alternative mitigation is identified in the vulnerability-specific advisory. Prioritize patching Internet-facing FortiNAC webservers and perform a business impact review before deployment. HTTP POST monitoring can help identify exploitation attempts but does not remediate the vulnerability.

Remediation

Patch, then assume compromise.

Upgrade to FortiNAC 9.4.1 or later, 9.2.6 or later, or 9.1.8 or later in the respective release branches. Fortinet also recommends FortiNAC F 7.2.0 or later. Apply the relevant security updates immediately, prioritizing Internet-facing installations.

Public exploits

Exploits

3 exploits validated by Mallory's analysis.

View more in app →
fortinac_keyupload_file_write.rbThis repository contains a single Metasploit module (Ruby) that exploits CVE-2022-39952, an arbitrary file write vulnerability in Fortinet FortiNAC's /configWizard/keyUpload.jsp endpoint. The exploit works by uploading a ZIP file containing a payload and a cron job to the target system. The payload is written to /tmp and the cron job to /etc/cron.d, resulting in the payload being executed as root. The module supports multiple payload architectures (command, Linux x86, Linux x64) and leverages Metasploit's payload generation and delivery mechanisms. The attack is unauthenticated and remote, requiring only network access to the vulnerable endpoint (typically HTTPS on port 8443). The exploit is weaponized, allowing for customizable payloads and automated cleanup. The repository is structured as a standard Metasploit module and is intended for use within the Metasploit Framework.Disclosed Feb 16, 2023 · Framework: metasploit · ruby · networkWeaponizedCVE-2022-39952This repository is a proof-of-concept exploit for CVE-2022-39952, a critical vulnerability in Fortinet FortiNAC. The exploit consists of a Python script (CVE-2022-39952.py), a sample payload file, and a README with usage instructions and technical background. The Python script creates a ZIP archive containing a user-supplied payload (typically a cron job script) and uploads it to the vulnerable keyUpload.jsp endpoint on the target FortiNAC system via HTTPS on port 8443. If successful, the payload is written to /etc/cron.d/payload on the target, allowing for arbitrary code execution. The provided payload establishes a reverse shell from the target to the attacker's machine. The exploit requires the attacker to supply a payload file and the target's IP address. The repository is operational and demonstrates a real-world attack scenario, with clear instructions and a working payload.horizon3ai · Disclosed Feb 20, 2023 · python · bash · networkOperationalCVE-2022-39952This repository contains a Python exploit for CVE-2022-39952, a critical vulnerability in Fortinet FortiNAC. The exploit consists of two files: a README.md with usage instructions and exploit.py, the main exploit script. The script allows an attacker to upload a malicious JSP webshell or reverse shell to a vulnerable FortiNAC server by abusing the /configWizard/keyUpload.jsp endpoint. The payload is delivered as a ZIP file containing the JSP file, which is written to /bsc/campusMgr/ui/ROOT/ on the target. The attacker can then interact with the webshell for arbitrary command execution or receive a reverse shell connection. The exploit supports targeting single or multiple hosts and can be configured for custom attacker host and port for the reverse shell. The attack vector is network-based, requiring access to the target's HTTPS interface. The exploit is operational, providing working payloads and automation for exploitation.Chocapikk · Disclosed Feb 26, 2023 · python · networkOperational
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
FortinetFortinacapplication
FAQ

Frequently asked questions

Is CVE-2022-39952 exploited in the wild?
Yes. As of Oct 16, 2026, Mallory has reports of exploitation in the wild.
Is there a public exploit for CVE-2022-39952?
Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2022-39952, the earliest disclosed Feb 16, 2023.
Is there a patch for CVE-2022-39952?
Upgrade to FortiNAC 9.4.1 or later, 9.2.6 or later, or 9.1.8 or later in the respective release branches. Fortinet also recommends FortiNAC F 7.2.0 or later.
What products are affected by CVE-2022-39952?
Fortinet Fortinac.
How severe is CVE-2022-39952?
CVE-2022-39952 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 57.2% (99th percentile) as of Oct 16, 2026.
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 evidence1Every report linking this CVE to a named adversary.
Associated malware2Malware families linked to this CVE, with evidence and IOCs.
Detection signatures3YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity1Community discussion across Reddit, Mastodon, and other social sources.