Port / TCP/UDP
11211Memcached
Memcached serves a distributed in-memory key/value cache with a deliberately minimal protocol.
If it is internet-facing: Finding 11211 open to the internet is a finding in its own right — it warrants an explanation, not just a rule.
Exposure
Localhost only
Transport
Cleartext
Risk if public
High
Exposure verdict
Port 11211 should be bound to 127.0.0.1. Nothing outside the host needs to reach it, and binding to 0.0.0.0 is the single change that turns it into an incident.
Traffic crosses the network readable and modifiable. Anything sensitive on this port needs a tunnel, a VPN, or a different protocol.
Registered with IANA on request, but bindable by any unprivileged user. Registration records intent — it does not reserve the port, so collisions between products are common.
Grouped with the other databases & caches ports so a rule written for one can be checked against its neighbours.
What actually goes wrong
2 notes- There is no authentication in the classic protocol; anyone who reaches the port reads and writes the cache.
- The UDP listener produced record-breaking amplification attacks in 2018 — disable UDP with '-U 0'.
Recommended firewall rule
Deny at the edge and bind to loopback
A firewall rule is the second line here. Fix the bind address in the service configuration so the listener never leaves the host.
ufw
sudo ufw deny 11211/tcp
sudo ufw deny 11211/udpiptables
sudo iptables -A INPUT -p tcp --dport 11211 -j DROP
sudo iptables -A INPUT -p udp --dport 11211 -j DROPIf you do need it open to everyone
sudo ufw allow 11211/tcp
sudo ufw allow 11211/udpWrite down why. An unexplained allow rule outlives the person who added it, and the next reviewer has no way to tell a deliberate exception from an accident.
Check what is really there
Listening locally
sudo ss -tulpn 'sport = :11211'The bind address is the answer that matters: 127.0.0.1 is local-only, 0.0.0.0 and :: mean every interface.
Listening (macOS)
sudo lsof -nP -iTCP:11211 -sTCP:LISTENmacOS ships lsof rather than ss; this names the owning process and user.
From outside
nmap -sSUV -Pn -p 11211 <host>A version probe confirms whether Memcached is actually what answers, rather than trusting the number. Only scan hosts you are authorised to test.
Reachability
nc -vz <host> 11211The quick yes/no when you only need to know whether a path exists through the firewall.