SaferComputing.com

Reference · Self-hosted services

Synology and QNAP NAS on the internet: ports 5000 and 5001, QuickConnect, myQNAPcloud and UPnP

Find every path from the internet to a NAS sign-in page: DSM on ports 5000 and 5001, QTS on 8080 and 443, router port forwards, UPnP rules, QuickConnect and myQNAPcloud. Close them, disable the admin account and keep snapshots for ransomware recovery.

Published
Updated
Last checked
Applies to
Synology DSM 7.2 to 7.4, QNAP QTS 5.2 and QuTS hero h5.2, and the router in front of them
Technical specification
Target artifactThe administration pages of a Synology network-attached storage (NAS) device, DiskStation Manager (DSM) on TCP 5000 (HTTP) and 5001 (HTTPS), or of a QNAP NAS, QTS on 8080 and 443, and every path to them from the internet: router port forwards, rules the NAS adds through Universal Plug and Play (UPnP), Synology QuickConnect and QNAP myQNAPcloud.
Default behaviourBoth listen on the local network. Once QuickConnect is on, its web portal can open DSM from any browser at quickconnect.to, and it adds the port forwarding rules it needs on routers that accept UPnP; myQNAPcloud can forward ports through UPnP too. QTS and QuTS hero 5.2 and later disable admin by default, but a system reset or restore turns it back on.
Safe stateNo port forward, demilitarized zone (DMZ) entry or UPnP rule for the NAS; QuickConnect off or limited to the apps you use; myQNAPcloud Link access Private or Customized; admin disabled; two-factor sign-in for administrators; automatic security updates; scheduled snapshots; nothing answers a test from outside.
Check in router settingsthe Port Forwarding, Virtual Server, NAT, DMZ and UPnP pages show no rule for the NAS's address
Check from another devicenc -vz -w 5 PUBLIC_IP 5001 from a network outside yours, then the same for 5000, 8080 and 443
Check on SynologyControl Panel > External Access > QuickConnect and Router Configuration, then a scan in Security Advisor
Check on QNAPmyQNAPcloud > Auto Router Configuration, then Security Center > Security Checkup > Scan on QTS 5.2 and later
Fix in router settingsdelete every port forward and DMZ entry for the NAS, and turn UPnP off
Fix on Synologyturn QuickConnect off or limit its apps, disable admin, enforce two-factor sign-in for administrators, turn on Auto Block and Account Protection
Fix on QNAPunselect Enable UPnP Port forwarding, set myQNAPcloud Link access to Private, update QTS and every app

Read the result

Reply to nc from outside your networkMeaning
succeeded! on 5000 or 5001DSM's sign-in page is on the internet: delete the forward now
succeeded! on 8080 or 443QTS's sign-in page, or another service on that port, is on the internet
Connection refused, or a time-out after 5 secondsNot reachable on that port from where you tested

The port test cannot see QuickConnect or myQNAPcloud Link, which go through the vendor's servers: check them below. On a QNAP NAS, 5000 and 5001 are WebDAV's default ports.

Why a NAS sign-in page stays off the internet

DateWhat happened, according to the vendorWhat the vendor said to do
23 July 2019Synology: password guessing from botnet addresses against administrator accounts on NAS from several vendors, then ransomware; not a vulnerabilityDisable the default admin, Auto Block, Security Advisor, the firewall with public ports only when necessary, 2-step verification, snapshots
22 April 2021QNAP: Qlocker and eCh0raix encrypting data; advisories QSA-21-11 and QSA-21-13, a critical Hybrid Backup Sync flaw (CVE-2021-28799)Update Multimedia Console, Media Streaming Add-on and Hybrid Backup Sync; change the default port 8080; 3-2-1 backups
26 January 2022QNAP: DeadBolt "widely targeting all NAS exposed to the Internet without any protection"Delete router forwards to the management ports, 8080 and 443 by default; unselect Enable UPnP Port forwarding; myQNAPcloud Link; update QTS
3 and 12 September 2022QNAP QSA-22-24: DeadBolt through Photo Station, CVE-2022-27593, criticalPhoto Station 6.1.2 or later on QTS 5.0.1; turn off the router's DMZ and UPnP; regular snapshots

Synology DSM

Ports 5000 and 5001, Router Configuration and the firewall

Synology gives DSM's default ports as HTTP 5000 and HTTPS 5001. Changing them in Control Panel > Login Portal can deter "common threats that only attack predefined services", Synology says, but cannot prevent targeted attacks.

DSM sets up port forwarding rules on the router from Control Panel > External Access > Router Configuration: delete those you do not need, then check the router itself. To filter what still reaches the NAS, tick Enable firewall in Control Panel > Security > Firewall; rules filter by source address, range, port or location.

QuickConnect

QuickConnect reaches the NAS over the internet without port forwarding rules, through a direct connection, a tunnel or Synology's relay. Its web portal, quickconnect.to/ and the QuickConnect ID, serves the web interface, DSM included, to a browser anywhere. On routers that accept UPnP, it applies the port forwarding rules it needs.

  1. In Control Panel > External Access > QuickConnect, untick Enable QuickConnect if nobody uses it.
  2. Otherwise limit it to the apps you need: in DSM 7.4, administrators choose which applications QuickConnect reaches.
  3. From a phone on mobile data, open your quickconnect.to address. A DSM sign-in page means DSM is on the internet.
The admin account, two-factor sign-in, Auto Block and Account Protection
  • Synology's advice in 2019 and 2020: create your own administrator account and disable the system default admin. Accounts are in Control Panel > User & Group > User.
  • Each user turns on two-factor sign-in in Personal > Security > 2-Factor Authentication, with codes from an app such as Synology Secure SignIn. DSM 7.4 can enforce it for a group: enforce it for administrators.
  • In Control Panel > Security > Protection, Auto Block blocks an address after a set number of failed sign-ins within a set time, for DSM, SSH, SMB, FTP, VPN and other services; in Control Panel > Security > Account, Account Protection blocks untrusted clients that fail too often.
  • Security Advisor > Overview > Scan checks the NAS and suggests fixes; Advanced schedules regular scans.
Updates

In Control Panel > Update & Restore > DSM Update > Update Settings, choose Automatically install important updates that fixed critical security issues and bugs. This covers minor updates only: install major versions yourself. DSM cannot return to an earlier version after an update.

QNAP QTS and QuTS hero

Ports 8080 and 443, and myQNAPcloud

QNAP lists the NAS web interface on 8080 (HTTP) and 443 (HTTPS). To stop the NAS forwarding its own ports: myQNAPcloud > Auto Router Configuration, unselect Enable UPnP Port forwarding.

For access from outside, QNAP points to myQNAPcloud Link, which goes through myQNAPcloud servers without exposing the NAS, and recommends a VPN for better speed and connection security. In myQNAPcloud Link > Access Control > Device Access Controls, Private admits only your myQNAPcloud account and Customized only accounts you name; Public "Allows access to anybody". QSA-22-24 also says to stop publishing NAS services in myQNAPcloud.

The admin account

Every QNAP NAS has an admin account that cannot be deleted. On QTS and QuTS hero 5.2.0 and later it is disabled by default, but a system reset or restore turns it back on, with the device's Cloud Key as its password; earlier versions used the first MAC address or admin. QNAP recommends creating another administrator first, then editing admin under Control Panel > Users and ticking Disable this account. Check again after any reset or restore.

Security Center and updates

On QTS 5.2 and later, Security Center > Security Checkup > Scan checks, among other rules, "Is your NAS directly exposed to the internet?", whether the default admin password was changed, and whether firmware and apps are current. Update firmware in Control Panel > System > Firmware Update, and apps in App Center.

Find what the router forwards

  1. Find the NAS's local address in the router's list of connected devices.
  2. On the router's Port Forwarding, Virtual Server or NAT page, delete every rule for that address. QNAP's 2022 advice also says to turn off the router's DMZ.
  3. Turn UPnP off on the router. Router remote administration, UPnP and WPS lists the rules programs added, with upnpc -l.
  4. From another network, such as a phone's hotspot, run nc -vz -w 5 PUBLIC_IP 5001 and repeat for 5000, 8080 and 443.

Snapshots for ransomware recovery

  • Synology: Snapshot Replication takes scheduled snapshots of shared folders on Btrfs volumes, as often as every 5 minutes; earlier versions of files open in File Station or Windows File Explorer. On supported models, immutable snapshots "cannot be deleted via any method within a specified period".
  • QNAP: snapshots need at least 1 GB of memory and restore a whole volume or single files, also from Windows File Explorer. QNAP changed its snapshots in 2021 so that ransomware cannot delete them, and after the Photo Station attacks said users with regular snapshots could restore their data.

Local snapshots share the NAS's disks with the data: QNAP's April 2021 statement also asks for backups under the 3-2-1 rule.

Sources