Skip to content
statance
MenuClose
← All ports

Port 631: IPP (CUPS printing)

High risk

Port 631 is the Internet Printing Protocol. CUPS listens on TCP 631 for print jobs and its web interface, and cups-browsed listens on UDP 631 to discover printers. It should not be reachable from the public internet.

Port
631
Protocol
TCP and UDP
Service
IPP (CUPS printing)
Expose to internet?
No
Also used by
CUPS, cups-browsed, network printers

Is port 631 safe to open?

Printing services are meant for the local network. In 2024 a chain of vulnerabilities in cups-browsed showed that a single UDP packet to port 631 could add a malicious printer and lead to remote code execution when a job was printed. Servers rarely need CUPS at all.

How to secure IPP (CUPS printing)

  • On servers that do not print, remove CUPS or stop it: sudo systemctl disable --now cups cups-browsed.
  • Make CUPS listen on localhost only (Listen localhost:631 in /etc/cups/cupsd.conf).
  • Block TCP and UDP 631 from the internet.

Check if port 631 is open

Linux: what is listening on this port

sudo ss -tulpn | grep ':631 '

Windows (PowerShell): what is listening

Get-NetTCPConnection -LocalPort 631 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}

From another machine: is it reachable

nc -zv HOST 631 # or nmap -p 631 HOST # Windows Test-NetConnection HOST -Port 631

Restrict port 631 in the firewall

Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:631:631) instead of relying on the host firewall.

ufw: allow only your private network, deny everyone else

sudo ufw allow from 10.0.0.0/8 to any port 631 proto tcp sudo ufw deny 631/tcp

firewalld: allow one source network only

sudo firewall-cmd --permanent --remove-port=631/tcp sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="631" protocol="tcp" accept' sudo firewall-cmd --reload

iptables

sudo iptables -A INPUT -p tcp --dport 631 -s 10.0.0.0/8 -j ACCEPT sudo iptables -A INPUT -p tcp --dport 631 -j DROP

Windows Firewall (PowerShell, as Administrator)

New-NetFirewallRule -DisplayName "Block 631 from internet" -Direction Inbound -Protocol TCP -LocalPort 631 -RemoteAddress Internet -Action Block

Monitor port 631

Run a TCP port monitor against your public IP on port 631: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.

Related ports

Port 9100Prometheus node_exporter / JetDirect printingMedium risk

FAQ

What is port 631 used for?

Port 631 is the Internet Printing Protocol. CUPS listens on TCP 631 for print jobs and its web interface, and cups-browsed listens on UDP 631 to discover printers. It is also used by CUPS, cups-browsed, network printers.

Is it safe to open port 631?

Not to the public internet. Printing services are meant for the local network. In 2024 a chain of vulnerabilities in cups-browsed showed that a single UDP packet to port 631 could add a malicious printer and lead to remote code execution when a job was printed. Servers rarely need CUPS at all.

Is port 631 TCP or UDP?

IPP (CUPS printing) uses TCP and UDP on port 631.

How do I check if port 631 is open?

On the server, run sudo ss -tulpn | grep ':631 ' (Linux) or Get-NetTCPConnection -LocalPort 631 (Windows) to see what is listening. From another machine, run nc -zv HOST 631 or Test-NetConnection HOST -Port 631.

All ports →

Know the moment a port stops answering.

TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.