Skip to content

Cybersecurity

UPnP - threats and security of the Universal Plug and Play protocol

UPnP opens ports without authentication. Learn about attack vectors, real incidents (CallStranger, EternalSilence), and practical methods to protect your network.

Michał NiwickiMichał Niwicki

Published 11 min read

UPnPSSDPIoTnetwork securityDDoSNATport forwarding
UPnP - threats and security of the Universal Plug and Play protocol
Contents
  1. What UPnP is and how it works
  2. Full UPnP attack surface
  3. Real incidents involving UPnP
  4. UPnP in industrial and building environments
  5. Protection mechanisms - full checklist
  6. Standards and recommendations references
  7. Monitoring and detection
  8. Summary
  9. Sources

In March 2019, Akamai published a report documenting over 45,000 routers with compromised NAT tables - all due to a single protocol: UPnP. The campaign, dubbed EternalSilence, exploited vulnerabilities in Universal Plug and Play implementations to create hidden tunnels leading directly to internal SMB services. Home and corporate routers became silent gateways for attackers, and their owners had no idea.

This article explains what UPnP is, why its default configuration poses a real threat to home, corporate, and industrial networks, and what steps to take to minimize risk.

What UPnP is and how it works

Universal Plug and Play (UPnP) is a set of network protocols that allows devices to automatically discover each other and establish communication without manual configuration. The protocol was developed in 1999 by the UPnP Forum (now the Open Connectivity Foundation - OCF) and operates across several layers:

Layer Protocol Function
Discovery SSDP (Simple Service Discovery Protocol) Devices broadcast their presence to multicast address 239.255.255.250:1900
Description HTTP + XML Device provides an XML file describing its services
Control SOAP (Simple Object Access Protocol) Applications invoke actions on the device via SOAP envelopes
Eventing GENA (General Event Notification Architecture) Device notifies subscribers of state changes
Presentation HTTP Device web interface

Port mapping mechanism

The key UPnP function from a security perspective is the ability to automatically create port forwarding rules on the router (NAT traversal). An application running on the local network can send a SOAP request to the router asking to map an external port to an internal IP address and port - without providing an administrator password.

Example SOAP request creating a port mapping:

<?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:WANIPConnection:1">
      <NewRemoteHost></NewRemoteHost>
      <NewExternalPort>18080</NewExternalPort>
      <NewProtocol>TCP</NewProtocol>
      <NewInternalPort>8080</NewInternalPort>
      <NewInternalClient>192.168.1.100</NewInternalClient>
      <NewEnabled>1</NewEnabled>
      <NewPortMappingDescription>IP Camera</NewPortMappingDescription>
      <NewLeaseDuration>0</NewLeaseDuration>
    </u:AddPortMapping>
  </s:Body>
</s:Envelope>

WARNING

UPnP does not require authentication. Any device on the local network - including an infected computer, malware, or an unauthorized user - can create and modify NAT rules on the router without providing any credentials.

Full UPnP attack surface

Threats associated with UPnP extend far beyond port mapping alone. Below is a complete map of attack vectors.

1. Port forwarding abuse (NAT injection)

Any device on the local network can manipulate the router’s NAT table. An attacker (or malware) can:

  • Expose the router’s admin panel to the internet
  • Expose the web interface of an IP camera or NAS server
  • Redirect traffic intended for a legitimate service to a rogue host
  • Create a reverse tunnel (reverse proxy) to a C2 server

Notably, some firmware implementations allow UPnP rules to override static port mappings configured by the administrator.

2. SSDP reflection/amplification DDoS

The SSDP protocol uses UDP datagrams, enabling reflection/amplification attacks with a spoofed source address (IP spoofing). The attacker sends an M-SEARCH query with the victim’s IP address as the source. Each UPnP device responds to the victim’s address with a packet up to 30 times larger than the query.

30x

SSDP amplification factor

~2 M

SSDP reflectors accessible on the internet

1 / 40 min

frequency of SSDP reflection attacks per Cloudflare

45,113

routers with compromised NAT (Akamai, EternalSilence)

Sources: Cloudflare DDoS Threat Report 2025, Akamai Security Research, NETSCOUT ASERT

3. Remote code execution (RCE) in UPnP stacks

UPnP implementations in router firmware contain numerous vulnerabilities. The two most commonly exploited open-source stacks:

Stack Vulnerabilities Scope
libupnp (Intel SDK) CVE-2012-5958 through CVE-2012-5965 - buffer overflow in SSDP parsing functions Tens of millions of devices, many SOHO router models
MiniUPnPd CVE-2013-0229, CVE-2013-0230 - buffer overflow in SOAP request handling Popular home routers, OpenWrt firmware

4. Data exfiltration and network scanning (CallStranger)

Vulnerability CVE-2020-12695 (CallStranger) allows an attacker to manipulate the CALLBACK header in a UPnP SUBSCRIBE request:

  • Data exfiltration - redirecting information from the device to an external server
  • Internal port scanning - using the UPnP device as a proxy for network reconnaissance
  • DDoS - redirecting responses to the victim’s address

NOTE

CallStranger is a protocol-level vulnerability, not an implementation flaw. This means it affects every device compliant with the UPnP specification issued before the OCF patch of April 2020. At the time of disclosure, it was estimated to affect billions of devices.

Real incidents involving UPnP

The following table presents the most important documented campaigns and attacks that used UPnP as a vector.

Year Campaign/Malware UPnP Technique Impact
2016-2017 Pinkslipbot (QakBot/QBot) Used UPnP to open ports on infected machines, creating SOCKS5 proxies for C2 servers First malware after Conficker (2008) to use UPnP for building C2 infrastructure
2016 Mirai Scanning IoT devices with open Telnet ports (often exposed via UPnP) 1.2 Tbps DDoS attack on Dyn DNS, disrupting Twitter, Netflix, Reddit
2018 EternalSilence (UPnProxy) Injecting NAT rules on over 45,000 routers, exposing SMB services to the internet Potential exploitation of Eternal family exploits (EternalBlue, EternalRed)
2020 CallStranger (CVE-2020-12695) Abuse of SUBSCRIBE/CALLBACK mechanism Data exfiltration, internal network scanning, DDoS

Anatomy of the EternalSilence attack

The EternalSilence campaign, discovered by Akamai in 2018, is an example of creative UPnP exploitation at scale. The attackers:

  1. Scanned the internet for routers with UPnP exposed on the WAN port
  2. Injected NAT rules redirecting traffic from port 139/445 (SMB) to internal hosts
  3. The mapping descriptions contained the string “galleta silenciosa” (Spanish for “silent cookie/cracker”)
  4. Likely goal: exploiting EternalBlue/EternalRed to compromise machines on the internal network

Pinkslipbot - UPnP as botnet infrastructure

The banking trojan Pinkslipbot (also known as QakBot) stands out among malware that exploits UPnP. Its proxy module:

  1. Checks which ports are available on the infected host
  2. Uses UPnP to open those ports on the router
  3. Launches a multithreaded SOCKS5 proxy server
  4. The infected machine becomes a control node (C2 proxy) of the botnet

This way, even after cleaning the malware from the computer, the UPnP rules remain active on the router, keeping the ports open.

TIP

After removing a malware infection, always check the UPnP mapping table on the router. Malware such as Pinkslipbot leaves port forwarding rules that survive an operating system reinstallation.

UPnP in industrial and building environments

Although UPnP was designed for home networks, the protocol also appears in environments where it should not operate:

  • BMS (Building Management Systems) - HVAC controllers, lighting systems, and control panels may have UPnP enabled, creating unauthorized access paths from the corporate network or internet
  • IoT devices in industrial environments - surveillance cameras, environmental sensors, and network gateways connected to the OT network may broadcast services via SSDP
  • Edge routers and switches - devices at the IT/OT boundary with UPnP enabled violate the security zone separation principle in accordance with IEC 62443

WARNING

UPnP should not be enabled in any industrial network or building management segment. Automatic port mapping contradicts the fundamental principle of OT networks - every connection should be explicitly authorized and documented.

Protection mechanisms - full checklist

Disabling UPnP

The most effective protection is disabling UPnP on all routers and network devices. The process varies by manufacturer, but the general steps are:

  1. Log in to the router’s admin panel
  2. Navigate to the “Advanced” or “Network” section
  3. Find the “UPnP” option and disable it
  4. Save the configuration and restart the router
  5. Configure required port forwardings manually (static NAT rules)

Network audit for UPnP

To detect UPnP devices on the network, you can use an M-SEARCH query:

import socket

query = (
    'M-SEARCH * HTTP/1.1\r\n'
    'HOST:239.255.255.250:1900\r\n'
    'ST:upnp:rootdevice\r\n'
    'MX:2\r\n'
    'MAN:"ssdp:discover"\r\n'
    '\r\n'
)

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
s.settimeout(10)
s.sendto(query.encode(), ('239.255.255.250', 1900))

try:
    while True:
        resp, addr = s.recvfrom(65507)
        print(addr, resp.decode())
except socket.timeout:
    pass

Scanning and audit tools

Tool Use case Type
Nmap (upnp-info script) Detecting UPnP services on local and remote networks Open source
Miranda (UPnP client) Interacting with UPnP devices, service enumeration, testing Open source
UPnPy (Python) Programmatic discovery and manipulation of UPnP devices Python library
Tenable Nessus Vulnerability scanning, including UPnP exposure on WAN interfaces Commercial
GRC ShieldsUP! External port scanning - verifying whether UPnP exposes services to the internet Free online

Firewall rules

Even if UPnP is disabled, additional safeguards are recommended:

  • Block SSDP traffic on the WAN interface - drop UDP packets on port 1900 arriving from the internet
  • Block multicast 239.255.255.250 at network segment boundaries
  • Monitor new NAT rules - alert on unauthorized port mappings
  • Network segmentation - IoT devices should operate in an isolated segment (VLAN), without access to the production network

Full security checklist

  • UPnP disabled on all edge routers
  • UPnP disabled on internal routers and access points
  • Firewall rules blocking SSDP (UDP 1900) on WAN interfaces
  • Regular network scanning for devices broadcasting SSDP
  • Review of the NAT mapping table on routers (look for unknown entries)
  • IoT devices in a separate VLAN without access to the internal network
  • Router and network device firmware updated
  • Monitoring traffic on ports 1900/UDP and 5000/TCP
  • Verification that UPnP is not exposed on the WAN interface (external test)
  • Incident response procedure: what to do when you discover an unauthorized port mapping

Standards and recommendations references

Standard/Recommendation UPnP/automatic port mapping requirement
NIST SP 800-41 (Guidelines on Firewalls and Firewall Policy) Recommends disabling automatic firewall rule configuration by applications
CIS Controls v8, Control 4 (Secure Configuration) Requires removal of unnecessary services and protocols, including UPnP
CIS Controls v8, Control 12 (Network Infrastructure Management) Manual control of NAT rules, prohibition of automatic port mapping
IEC 62443-3-3 (System security requirements) Requires explicit authorization of every network connection in industrial environments
NIST SP 800-183 (Networks of Things) Recommends restricting discovery protocols in IoT networks

Monitoring and detection

Disabling UPnP is a preventive step. Equally important is the ability to detect attempts to exploit it:

Indicators of compromise (IoC) related to UPnP:

  • Unexpected UDP traffic on port 1900 to/from the WAN interface
  • New entries in the router’s NAT mapping table not created by the administrator
  • SOAP traffic (HTTP POST) directed to port 5000/TCP of a network device
  • Mapping descriptions containing suspicious strings (e.g., “galleta silenciosa” in the case of EternalSilence)
  • SMB traffic (port 139/445) arriving from the internet - an indicator of active NAT injection

What to do after detection:

  1. Immediately disable UPnP on the router
  2. Export and analyze the NAT mapping table
  3. Scan the internal network for compromise (especially SMB services)
  4. Update the router firmware to the latest version
  5. Change the router’s administrative credentials
  6. Consider replacing the router if the manufacturer does not provide patches

Summary

UPnP is a protocol designed for convenience, not security. The lack of authentication, automatic port mapping, and broad support in consumer devices make it an attractive attack vector. Campaigns such as EternalSilence, malware like Pinkslipbot, and vulnerabilities like CallStranger demonstrate that the threat is real and affects both home and corporate networks.

The key recommendation is simple: disable UPnP wherever possible, and configure required port forwardings manually. In industrial environments and critical infrastructure, UPnP should not be enabled at all - every network connection must be explicitly authorized.

If you need support with network security auditing or penetration testing that accounts for UPnP exposure - contact us.

Sources

  1. Akamai Security Research - UPnProxy: EternalSilence
  2. Tenable - CVE-2020-12695: CallStranger Vulnerability in UPnP
  3. Cloudflare - SSDP DDoS attack
  4. McAfee Labs - Pinkslipbot exploiting infected machines as control servers
  5. CISA - Heightened DDoS Threat Posed by Mirai and Other Botnets
  6. NETSCOUT ASERT - SSDP Diffraction, UDP Refraction, UPnP NAT Bypass
  7. NSF - An Overview of UPnP-based IoT Security: Threats and Countermeasures
  8. Cloudflare - DDoS Threat Report 2025
  9. CallStranger - Vulnerability checker (GitHub)

Need help in this area?

Our experts will help you assess the risk and plan next steps.

Talk to an expert

We'll discuss scope, methodology, and timeline.

Book a call