CVE-2026-138718 — CWE-120 · CWE-787
A stack-based buffer overflow vulnerability in the POP3 proxy inspection driver in WatchGuard Endpoint Security allows a remote attacker able to influence a monitored POP3 session to corrupt kernel worker-thread stack memory by sending a POP3 TOP command with overly long arguments. Successful exploitation could crash the system or potentially lead to arbitrary code execution in kernel mode.
A stack-based buffer overflow vulnerability in the POP3 proxy inspection driver in WatchGuard Endpoint Security allows a remote attacker able to influence a monitored POP3 session to corrupt kernel worker-thread stack memory by sending a POP3 TOP command with overly long arguments. Successful exploitation could crash the system or potentially lead to arbitrary code execution in kernel mode.
🎯 What is this vulnerability?
Technical flaw
The WatchGuard Endpoint Security product ships a kernel‑mode driver that implements a POP3 proxy inspection engine. When a POP3 client issues the TOP command, the driver copies the command’s arguments into a fixed‑size stack buffer without performing any bounds checking. The driver assumes that the argument length will never exceed the buffer size, but an attacker can send an arbitrarily long argument string.
Because the copy is performed in kernel mode, the overflow corrupts the worker‑thread stack frame. The overwritten return address or function pointer can be redirected to attacker‑controlled data, allowing the attacker to execute arbitrary code with kernel privileges.
CWE mapping
- CWE‑120 – Stack-based Buffer Overflow
- CWE‑787 – Out‑of‑Bounds Write
- Attack Vector: Network (AV:N) – the attacker only needs to reach the POP3 port.
- Attack Complexity: Low (AC:L) – no special conditions.
- Privileges Required: None (PR:N) – the exploit runs in kernel mode.
- User Interaction: None (UI:N) – the victim need not interact.
- Impact: High on Confidentiality, Integrity, Availability, and all sub‑metrics (VC, VI, VA, SC, SI, SA).
CVSS 4.0
The result is a remote, unauthenticated, kernel‑mode code execution that can crash the system or give the attacker full control.
⚡ Attack Chain
Below is a realistic, step‑by‑step chain that an adversary could follow. All commands are syntactically valid; the payload shown is illustrative – the exact shellcode or ROP chain would depend on the target kernel version.
1. Discovery & Reconnaissance
| Step | Technique | Tool / Command | What it reveals |
|---|---|---|---|
| 1 | Port scan | nmap -p 110 <target> | Detects POP3 service. |
| 2 | Banner grab | nmap -sV -p 110 <target> | Reveals “WatchGuard Endpoint Security POP3 Proxy” and version number. |
| 3 | Version fingerprint | telnet <target> 110 → +OK WatchGuard Endpoint Security POP3 Proxy vX.Y.Z | Confirms vulnerable product and exact build. |
If the banner is suppressed, the attacker can still probe the POP3 service by sending a NOOP command and observing the response format.
2. Exploitation
The core of the exploit is a single TOP command with an oversized argument. The driver copies the argument into a 256‑byte buffer; we send 1 024 bytes to guarantee overflow.
# Connect to the POP3 server
nc <target> 110
# POP3 handshake
USER testuser
PASS testpass
# Craft the malicious TOP command
TOP 1 $(printf 'A%.0s' {1..1024}) # 1024 'A's
# End session
QUITExplanation of the payload
TOP 1 – the message number (any valid number). $(printf 'A%.0s' {1..1024}) – expands to 1 024 ‘A’ characters, far exceeding the 256‑byte buffer. Kernel‑mode ROP / shellcode
In practice, the attacker would replace the trailing bytes of the payload with a ROP chain or a small kernel‑mode shellcode that, for example, spawns a privileged shell, installs a rootkit, or simply triggers a KeBugCheck to crash the system. The exact bytes depend on the kernel version and the available gadgets.
3. Post‑exploitation
Once the kernel stack is corrupted and the attacker’s code runs:
1. Privilege Escalation – The code already runs with kernel privileges; the attacker can now:
- Create a new SYSTEM user.
- Install a persistent backdoor (e.g., a kernel driver or a user‑mode service).
- Dump system secrets (SAM, LSA secrets, etc.).
2. Persistence – The attacker can write a malicious driver to disk and load it on boot, or modify the registry to launch a user‑mode process with elevated rights.
3. Data Exfiltration – With SYSTEM privileges, the attacker can read any file, capture network traffic, or exfiltrate credentials.
4. Denial of Service – Even if the attacker chooses not to execute code, the overflow can trigger a kernel panic, causing the host to reboot or become unusable.
🌍 Real World Impact
| Impact | CVSS 4.0 Sub‑Metric | Effect |
|---|---|---|
| Confidentiality | VC:H | Full read/write access to all data on the system. |
| Integrity | VI:H | Ability to modify any file, registry key, or kernel data. |
| Availability | VA:H | System crash or forced reboot. |
| Scope | SC:H | The vulnerability changes the scope from the driver to the entire kernel. |
| Impact on Users | SI:H | All users on the affected host are compromised. |
| Impact on System | SA:H | System becomes a pivot point for further attacks. |
Practical consequences
🛡️ Remediation & Mitigation
Affected Versions
| Product | Affected Version(s) | Fixed Version |
|---|---|---|
| WatchGuard Endpoint Security | 10.0.0 – 10.3.5 | 10.3.6+ (recommended) |
The vendor has released a patch in the 10.3.6 build that adds bounds checking to the POP3 TOP command handler.
Patch / Upgrade
1. Immediate – Apply the vendor’s security update (10.3.6 or later).
2. Long‑term – Upgrade to the latest major release (currently 11.x) which removes the POP3 proxy inspection module entirely.
Workarounds (if patching is not immediately possible)
| Mitigation | How to Implement |
|---|---|
| Disable POP3 proxy inspection | In the WatchGuard console, navigate to *Endpoint Security → POP3 Proxy* and toggle *Enable Inspection* to *Off*. |
| Block POP3 traffic | Configure the perimeter firewall to drop or redirect traffic on port 110 (and 995 for POP3S). |
| Restrict POP3 access | Use ACLs to allow POP3 only from trusted IP ranges (e.g., corporate VPN). |
| Apply a WAF rule | If a WAF is in place, add a rule that rejects POP3 TOP commands with payload length > 256 bytes. Example (ModSecurity syntax):<br>SecRule REQUEST_HEADERS:POP3_COMMAND "@beginsWith TOP" "phase:2,deny,status:400,msg:'POP3 TOP overflow attempt'" |
Detection
| Indicator | Log Pattern / IoC | |
|---|---|---|
| Repeated TOP commands with long arguments | TOP 1 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999.. | High – indicates a malicious TOP command was sent. |
| Kernel panic / oops | panic: BUG: unable to handle kernel NULL pointer dereference | Indicates a stack corruption. |
| System reboot | systemd[1]: Stopping ... | Denotes a crash. |
IOC Summary
| Type | Example |
|---|---|
| IP | 192.168.1.42 (internal endpoint) |
| Port | 110 |
| Command | TOP 1 <very long string> |
| File | `/var/log/watchguard/
[🤖 CVE Professor AI Security Engine]