Skip to content
IoT Crest

What is UPnP, and should you turn it off?

Updated , 8 min read

Short answer: UPnP (Universal Plug and Play) is a set of protocols that lets devices on a home network find each other and lets any of them ask the router to open a port to the internet, with no password and no prompt. That convenience is also the risk: a camera or a compromised device can expose itself without you knowing. On a network with smart home devices, turn UPnP off on the router unless something you use genuinely needs it, and forward the one port it needs by hand instead.

What is UPnP: how Universal Plug and Play lets devices open router ports without asking, why that is an IoT security risk, and what breaks if you turn it off.

This article covers what UPnP is and who maintains it, how discovery and automatic port forwarding work, why the port-forwarding part is a risk on a network full of IoT devices, what stops working when you switch it off, how to check what it has already opened, and the alternatives for consoles and remote access. It does not cover step-by-step menus for a particular router brand, DLNA media server setup, or game-specific network troubleshooting.

UPnP, short for Universal Plug and Play, is a group of networking protocols that lets devices on a local network discover each other and use each other’s services without any manual setup. The part most people meet is on the router: a setting labeled UPnP that lets any device on your network ask the router to open a port from the internet to itself, automatically and without a password. That one feature makes game consoles and some older cameras work out of the box, and it is also why security guides, including the IoT device security basics on this site, usually recommend switching it off. This article explains what UPnP does, how the automatic port forwarding works, why it matters for smart home and IoT devices, and what changes when you turn it off. The IoT security hub has the rest of the guides on securing connected devices.

What UPnP is

UPnP was developed by an industry group, the UPnP Forum, from 1999 onwards, with the aim of making networked devices as easy to connect as a USB peripheral: plug it in and it works. In 2016 the forum’s specifications passed to the Open Connectivity Foundation, which maintains them now.

The protocols cover four jobs:

  • Discovery. A device announces itself, or searches for others, using the Simple Service Discovery Protocol (SSDP). SSDP messages are sent over UDP to the multicast address 239.255.255.250 on port 1900, so every UPnP device on the local network hears them.
  • Description. Each device publishes an XML document, fetched over HTTP, listing what it is and which services it offers.
  • Control. Other devices call those services with SOAP messages, which are XML sent over HTTP.
  • Eventing. A device can subscribe to another’s state changes and be notified when they happen.

None of this involves a username or a password. UPnP was designed on the assumption that everything on the local network is trusted. That assumption is the root of every security problem described below.

UPnP turns up in more places than the router. Media streaming between a network drive and a smart TV usually runs over DLNA, which is built on UPnP’s discovery and description. Printers, speakers and media players announce themselves with SSDP. Those uses stay inside the home network, and the router’s UPnP switch does not normally affect them.

The part that matters: automatic port forwarding

Home routers use network address translation (NAT). Every device inside shares one public address, and the router lets in only the replies to connections that inside devices started. A device that needs to accept a connection started from the internet, such as a game console hosting a match or a camera serving a live view, needs a port forward: a rule that sends traffic arriving on a given public port to a given device.

UPnP includes a service for exactly that, the Internet Gateway Device protocol (IGD). A router that supports it advertises the service on the local network, and any device can call it to add a port mapping: “send traffic for public port 8080 to me, port 80”. The router opens the port and the device is reachable from the internet. Nobody is asked, and on most routers nothing is shown unless you go looking.

How a device opens a port with UPnP IGD camera on LAN home router the internet 1 SSDP search, UDP 1900 2 "I am a gateway" 3 fetch description 4 AddPortMapping 8080 no password, no prompt 5 anyone reaching public port 8080 lands on the camera
Diagram: a camera on the home network sends an SSDP search on UDP port 1900, the router answers that it is an internet gateway, the camera reads the router's description and then asks it to map public port 8080 to itself. From then on, anyone on the internet who connects to that port on the home's public address reaches the camera directly.

Mappings can be permanent or carry a lease time, and well-behaved software removes its mapping when it is done. Plenty does not, so a router that has had UPnP on for a few years often holds mappings for devices that are long gone.

Why UPnP is a risk on a network with IoT devices

The protocol does what it was designed to do. The problem is who gets to use it.

Any device can expose itself. A camera, a video recorder or a network drive that opens a port for “remote access” puts its own login page on the internet. If that device still has its default password or runs old firmware, it can now be found by the automated scanners that sweep the internet looking for exactly that. The owner never chose to publish it and often does not know it happened.

Malware can use it too. UPnP cannot tell a legitimate request from a malicious one. Software running on any compromised device inside the network, a laptop or a cheap smart plug, can ask the router to open a port back to itself, which gives an attacker a way in that bypasses the router’s normal protection.

Some routers answer from the wrong side. UPnP is meant to be reachable only from the local network. Security researchers have repeatedly found routers whose UPnP services also answer requests arriving from the internet, which lets anyone outside add port mappings or read the router’s details. That is a bug in the router, and the only fix is a firmware update or switching the feature off.

Discovery has been abused for attacks on others. SSDP answers a small request with a larger reply, and on UDP the sender’s address can be forged. Devices that expose SSDP to the internet have been used to amplify denial-of-service floods against third parties, which is why the US cybersecurity agency lists SSDP among the UDP amplification vectors it warns about. In 2020 a further flaw in UPnP’s eventing, named CallStranger and recorded as CVE-2020-12695, showed that the subscription mechanism could be misused to send data or traffic to an address of the attacker’s choosing.

None of these needs a sophisticated attacker, and they sit alongside the other common IoT vulnerabilities. They rely on devices that are never looked at again once they work, which describes most of the connected devices in a typical home.

What stops working if you turn UPnP off

Switching UPnP off on the router removes the automatic port-mapping service. Local discovery between devices usually carries on as before. In practice the changes are smaller than people fear.

After switching UPnP off on the router Usually unaffected web, streaming, apps cloud-connected cameras smart speakers, plugs casting to a TV DLNA inside the home video calls all start connections outward May need attention console NAT type and hosting online matches older cameras and NVRs with direct remote view self-hosted servers, some peer-to-peer apps fix: one manual forward or a VPN
Diagram: most connected devices keep working when UPnP is switched off, because they reach the internet by starting connections outward and the router lets the replies in. What may need attention is anything that waits for connections started from outside: game consoles hosting matches, older cameras and video recorders offering direct remote viewing, and self-hosted servers.

Most modern smart home devices, including cloud-connected cameras, doorbells, speakers and plugs, connect outward to their maker’s servers and keep that connection open, so the router lets the traffic back in without any port forward. They work the same with UPnP on or off.

The things that may change:

  • Game consoles may report a stricter NAT type, which can affect hosting matches and voice chat with some players. A manual port forward to the console, using the ports the console maker publishes, restores it.
  • Older cameras and network video recorders that offer direct remote viewing by opening a port will stop being reachable from outside. That is usually the point. Use the maker’s cloud app if it has one, or a VPN into the home network.
  • Self-hosted services such as a media server reached from outside the home need a manual forward or, better, a VPN.

How to check what UPnP has already opened

Before switching it off, look at what it has done. Most routers list current UPnP port mappings on the same page as the setting, often under advanced, NAT or port forwarding. Each entry shows a public port, the internal address it points to and usually a description written by the device that asked for it.

Work through the list. Match each internal address to a device using the router’s list of connected clients. Anything you do not recognize, any camera or recorder, and any mapping to a device you no longer own deserves attention. Switching UPnP off and restarting the router clears the dynamic mappings on many models; check the list again afterward.

While you are on the router, update its firmware. Several of the UPnP flaws found over the years were fixed by updates that many routers never received because nobody installed them.

Safer ways to get the same result

Manual port forwarding. If one device genuinely needs incoming connections, add a single forward for that device and those ports by hand. It is visible, deliberate and only covers what you chose. Give the device a fixed address in the router’s DHCP settings so the forward keeps pointing at it.

A VPN for remote access. To reach a camera, a recorder or a home controller from outside, connect to the home network through a VPN rather than exposing each device. Many routers include a VPN server, and the local-only smart home guide covers remote access without opening ports to every device.

Keep IoT devices on their own network. Putting smart devices on a separate VLAN with firewall rules limits what a misbehaving device can reach. If the router allows it, stop the IoT network from reaching the router’s UPnP service at all, so even with UPnP on for a console on the main network, the camera on the IoT network cannot open ports.

Newer port-control protocols. NAT-PMP (RFC 6886) and its successor, the Port Control Protocol (RFC 6887), do the same job as UPnP IGD with a simpler design. They still let devices open ports without asking you, so the same judgment applies: on if something needs it, off otherwise.

Should you turn UPnP off?

On a network that holds smart home or other IoT devices, the usual answer is yes. The devices most likely to use UPnP to expose themselves are the ones least likely to be kept up to date, and the convenience it offers is needed by few of them today. Turn it off, note anything that complains, and give that one device a manual forward or a VPN instead.

If a household has a games console that struggles without it, a middle path is to leave UPnP on only for the main network and keep the cameras, plugs and sensors on a separate IoT network that cannot use it. Whatever you choose, review the router’s port-forward and UPnP lists now and then, and keep the router’s firmware current. For the other habits that keep connected devices safe, start with the IoT device security basics and the rest of the IoT security guides.

Written by the IoT Crest editorial team. Facts in this article follow the editorial policy: only well-established behavior is stated and no figures are invented.

More from IoT security

  1. IoT security standards and laws explained

    Which IoT security rules apply in the US, UK and EU: ETSI EN 303 645, NIST IR 8259, the Cyber Trust Mark, California's law, UK PSTI and the EU CRA.

  2. IoT vulnerabilities: the common weak points

    IoT vulnerabilities explained: the OWASP IoT Top 10 in plain words, why connected devices are exposed, how Mirai spread and how to look up a device's CVEs.

  3. IoT device security basics: default passwords, updates and network segmentation

    IoT device security basics: change default passwords, turn on updates, close unused services, segment the network and check what a device talks to.

  4. How to put IoT devices on a separate VLAN at home or in a small office

    How to put IoT devices on a separate VLAN: what you need, how to tag the Wi-Fi network, the firewall rules that contain devices, and discovery.

  5. Firmware updates for IoT devices: OTA, signing and rollback explained

    IoT firmware updates explained: how over-the-air updates are delivered, why images are signed, how rollback protects a device and what to ask a vendor.

All IoT security articles

Sponsor an article in this topic

Sponsored articles and in-article link placements for IoT vendors, agencies and SEO buyers. Every sponsored piece is labeled, edited to the same standard as the rest of the site, and placed in the hub its readers already visit. Rates on request.

Ask a question

Ask a question

Spotted an error, or want a topic covered? It goes straight to the editors, who reply by email, WhatsApp or SMS.