Is port 11211 (Memcached) exposed to the internet?
Memcached is a fast in-memory cache that ships with no authentication and no network restriction by default — its own project documentation says plainly it must not be exposed to the internet. CISA has measured its DDoS amplification factor at up to 51,000x. AdminKit's port-check tool automates nine common exposure checks today; here's how to check 11211 yourself.
By AdminKit team, Netbase JSC · Updated
Key takeaways
- Memcached has no login on its default build and listens on every interface unless started with
-l. Anyone who reaches TCP 11211 can read, overwrite and flush the cache. - The project’s own documentation says it must not be exposed to the internet, and calls its authentication options a help rather than a defence.
- The UDP side is the DDoS problem: CISA lists an amplification factor of 10,000 to 51,000. UDP has been off by default since 1.5.6 (February 2018), after attacks such as the 1.35 Tbps flood GitHub reported.
- A one-line
statsrequest from outside tells you whether the cache answers and which version it runs. - Fix it with a private bind address, UDP off, a firewall rule for both TCP and UDP 11211, and SASL or token authentication as a second layer.
What was Memcached designed to defend against?
Memcached is a widely used in-memory key-value cache, and IANA’s Service Name and Port Number Registry formally registers both TCP and UDP port 11211 to it under the name memcache. Its own official configuration documentation is unusually direct about the threat model it was built for: “Memcached does not spend much, if any, effort in ensuring its defensibility from random internet connections. So you must not expose memcached directly to the internet, or otherwise any untrusted users.” That’s not a hedge buried in a security appendix — it’s the project’s own framing of what the software is and isn’t designed to resist.
The same page lists the switches that decide exposure. -l binds to specific interfaces or addresses; without it the server listens on all of them. -p sets the TCP port, and the UDP port follows it. -U sets the UDP port separately, and has defaulted to off since 1.5.6; -U 0 turns UDP off explicitly. -s moves the server to a Unix socket and disables TCP and UDP altogether, the narrowest option when the application runs on the same host.
What can someone do over TCP 11211?
An internet-reachable, unauthenticated Memcached instance exposes whatever an application cached in it — session identifiers, database query results, anything stored there for speed rather than for public access — to any caller that can reach the port. Memcached’s protocol specification is a plain-text command set, so none of this needs special tooling:
| Command | What it gives an outsider |
|---|---|
stats, stats settings | Version, uptime, memory size, and whether SASL is on |
lru_crawler metadump all | One line per stored item with its key, so the whole key space can be listed |
get <key> | The cached value: a session, a rendered page fragment, a query result |
set <key> | Replaces a cached value with one of the caller’s choosing |
flush_all | Invalidates every item at once |
Reading is the obvious harm. Writing is the less obvious one: an application that trusts what it reads back from its cache will serve or act on whatever an outsider wrote there, until the item expires. And flush_all sends every request back to the database at once, which on a busy site can turn a cache problem into an outage.
Is the UDP amplification risk still real?
Memcached’s UDP interface adds a second, unrelated risk: it can be abused as a reflection amplification vector, where an attacker sends a small forged-source-address request and the server replies with a response many times larger, aimed at whatever third-party address the attacker spoofed. CISA’s advisory on UDP-based amplification attacks lists memcached’s bandwidth amplification factor at 10,000 to 51,000 — far higher than any other protocol on that same list — meaning a server with nothing sensitive cached at all can still be conscripted into flooding someone else’s infrastructure, with your IP address as the apparent source.
The large factor comes from the attacker’s own preparation. The 1.5.6 release notes describe it: attackers set large values into an exposed instance, then send small spoofed UDP requests for them, and the server answers with a large number of large packets. NVD records the issue as CVE-2018-1000115 against 1.5.5, with the fix in 1.5.6 being UDP switched off by default. The same week, GitHub’s incident report described an amplification attack built on memcached that peaked at 1.35 Tbps from tens of thousands of unique endpoints.
So the UDP risk today sits with three kinds of server: releases older than 1.5.6 still in service, newer servers started with -U 11211 or a packaged config that sets it, and anything where you have not checked. The TCP risk applies to every release.
What authentication can Memcached use, and why isn’t it the main control?
Memcached does support SASL authentication, but the project’s own documentation is careful not to oversell it: “Using SASL authentication here helps, but should not be totally trusted.” The guidance that follows treats network-level restriction — binding to a private or loopback interface, not all interfaces — as the actual primary control, with authentication as a secondary layer on top of that, not a substitute for it.
There are two mechanisms, and both have conditions:
- SASL. The SASL how-to requires a server built with
--enable-sasland started with-S, which also restricts the server to the binary protocol. Clients that only speak the text protocol stop working, which is one reason it is often left off. - Token file for the text protocol. The protocol specification describes optional username and password authentication enabled with
-Y, which the client sends as a specialsetcommand before anything else.
The protocol document also notes that TLS is a compile-time opt-in available from 1.5.13. Without it, any password and every cached value cross the network in clear text.
How do you check your own exposure?
AdminKit’s port-check tool automates reachability checks for a fixed set of nine commonly-misconfigured ports, and 11211 isn’t on that list. It also probes TCP only, so it would not see the UDP side even if the port were added. Confirm your current public IP with what is my IP, then test the port manually from a machine outside your network:
nc -vz -w 3 203.0.113.5 11211
A successful connection means the port is reachable from the internet; “connection refused” or a timeout means it’s closed or filtered. Run this only against a host you own or are authorized to test.
To see whether the cache actually answers, send one stats request over TCP, and one over UDP with the 8-byte frame header the protocol requires (request ID 1, sequence 0, one datagram):
$ printf 'stats\r\nquit\r\n' | nc -w 3 203.0.113.5 11211 | head -3
$ printf '\x00\x01\x00\x00\x00\x01\x00\x00stats\r\n' | nc -u -w 3 203.0.113.5 11211 | head -c 200
Example replies (illustrative; documentation address):
| Reply | What it means |
|---|---|
Lines starting STAT pid, STAT uptime, STAT version 1.6.x over TCP | The cache is open to the internet with no authentication. |
CLIENT_ERROR unauthenticated or a closed connection right after the command | A form of authentication is on, but the port is still reachable. |
Any STAT data back over UDP | The server can be used for amplification. Treat this as urgent. |
| Nothing on either | Nothing answering on 11211 from where you tested. A silent UDP test is expected, not proof; check the host as well. |
How do you confirm the listener on your own host?
On the cache server, list both TCP and UDP sockets, then ask the running server what it was told to do. The second command is the same check the configuration documentation recommends:
$ ss -ltunp | grep 11211
tcp LISTEN 0 1024 0.0.0.0:11211 0.0.0.0:* users:(("memcached",pid=611,fd=26))
$ echo "stats settings" | nc 127.0.0.1 11211 | grep -E "tcpport|udpport|inter |auth_enabled_sasl"
STAT tcpport 11211
STAT udpport 0
STAT inter NULL
STAT auth_enabled_sasl no
Both blocks are examples. 0.0.0.0:11211 and inter NULL mean no -l was given, so every interface is listening. udpport 0 means UDP is off. A udp line in the ss output, or a non-zero udpport, means it is on.
How do you fix it?
- Bind Memcached to localhost or a private interface instead of all interfaces — the project’s own documentation treats this as the primary control, not a secondary one.
- Turn UDP off explicitly with
-U 0, even on releases where it is already off by default, so a packaged config cannot switch it back on. - Firewall both UDP and TCP port 11211 to only the application servers that actually need it, closing the data-theft and amplification risks at the same time.
- Enable SASL authentication as an additional layer, not a replacement for restricting network access, matching the project’s own “helps, but should not be totally trusted” caveat.
- Upgrade anything older than 1.5.6, and prioritize this check on any host where a UDP test answered, since CISA ranks Memcached’s 10,000–51,000x amplification factor as the highest of any protocol on its list.
- Audit caching layers, CMS platforms and container images for instances spun up with permissive default network settings, since Memcached’s own default is open rather than restrictive.
A start-up line for a cache that serves one application server on a private network:
memcached -l 10.0.2.31 -p 11211 -U 0 -m 1024 -c 1024
If the application runs on the same machine, -s /run/memcached/memcached.sock removes the network listener altogether.
Does the same pattern apply to other fast data stores?
Memcached’s risk profile closely mirrors Redis’s and Elasticsearch’s own default-open design — software built for speed inside a trusted network, not for defending itself at the edge. The fix pattern is the same across all three: restrict network access first, treat any built-in authentication as a second layer rather than the whole plan, and never assume a service is private just because nobody deliberately opened its port. The Redis guide is the longer walkthrough for testing an unauthenticated data store from outside.
Which servers may you test with these checks?
Every check this page links to is for assets you own or are explicitly authorized to test. Never scan, probe, or attempt to connect to a network or device you don’t control — AdminKit’s active checks only ever run against the IP making the request or an asset you’ve verified ownership of. See our Disclaimer and Acceptable Use Policy for the full terms.
This guide is part of AdminKit’s machine protocols cluster, which covers exposure checks for exactly this category of service — fast, trusted-network-by-design software that quietly ends up reachable from the open internet.
This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.
Frequently asked questions
Why is an exposed Memcached instance considered high risk?
Two separate risks stack on the same misconfiguration. First, Memcached's own maintainers state plainly that it 'does not spend much, if any, effort in ensuring its defensibility from random internet connections,' so an unauthenticated instance lets anyone read or write whatever's cached. Second, if its UDP interface is enabled, it can be abused as a reflection amplification vector for DDoS attacks against a completely unrelated third party, turning your server into unwilling infrastructure for someone else's attack.
Does Memcached require a password by default?
No. Memcached's official configuration documentation does note that SASL authentication is available, but adds the caveat that it 'helps, but should not be totally trusted' as a complete substitute for keeping the service off the public internet in the first place. The project's own guidance is to bind it to a private or loopback interface, not to rely on authentication alone.
Does AdminKit's port-check tool scan port 11211?
No. The tool checks a fixed list of nine specific TCP ports (23, 554, 1883, 8883, 502, 7547, 80, 443, 8080) chosen for how often they turn up misconfigured on home and small-office devices — see the port-check tool page for the current list. 11211 isn't on that list, and the tool doesn't probe UDP at all, so confirm your own exposure with the manual check below.
Is this a data-theft risk, a DDoS risk, or both?
Both, and they're independent of each other. An attacker who can read your cache gets whatever your application stored there — session data, query results, anything cached for speed. Separately, CISA's own advisory on UDP-based amplification attacks lists Memcached with a bandwidth amplification factor of 10,000 to 51,000, by far the highest of any protocol on that list. That second risk needs UDP, which Memcached has left off by default since version 1.5.6, so it mainly affects older installs and servers started with UDP switched back on.
What's the fastest fix if port 11211 answers from outside my network?
Bind Memcached to localhost or a private interface rather than all interfaces — the project's own documentation treats this as the primary control, not a secondary one — then firewall UDP and TCP 11211 to only the application servers that actually need it. Enable SASL authentication as a second layer, not a replacement for restricting network access in the first place.
Sources
- CISA — UDP-Based Amplification Attacks
- Memcached — official server configuration documentation
- Memcached — 1.5.6 release notes (UDP disabled by default)
- Memcached — protocol specification
- Memcached — SASL how-to
- NVD — CVE-2018-1000115 (Memcached UDP amplification)
- GitHub — February 28th DDoS incident report (2018)
- IANA Service Name and Port Number Registry
Want AdminKit to watch this for you?
Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.
Talk to an expert
Huy Nguyen (David), Founder & CEO, Netbase JSC
Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.