Memcached Exposed to Untrusted Networks

A Memcached server can be reached from untrusted networks without authentication, exposing cached data to reading and tampering and, over UDP, to abuse in reflection attacks.

SeverityHigh
CVSS 3.17.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L Open in the calculator
CVSS 4.06.9 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N Open in the calculator
CWECWE-306: Missing Authentication for Critical Function
OWASP Top 10A07:2025 Authentication Failures
MITRE ATT&CKT1498.002 Reflection Amplification, T1565.001 Stored Data Manipulation
CategorySecurity Misconfiguration

Description

The Memcached service can be reached from networks that have no need to use it. Memcached is designed to run on a trusted network beside the application servers that use it and, in its usual configuration, has no authentication: any client that can connect can issue the same commands as the application. It listens on all interfaces unless told otherwise, and releases before 1.5.6 also answered on UDP by default.

Anyone who can reach the service can therefore read cached items, which may include session data, user records, tokens or query results, and can change or delete them, which could corrupt application behaviour, poison cached content or sign users out, for example with flush_all. Where UDP is enabled, an attacker can also send small spoofed requests that make the server send far larger responses to a victim. CISA's guidance on UDP amplification lists Memcached with the largest amplification factor of the protocols it covers, so an exposed server is a powerful source of denial-of-service traffic against third parties. The impact depends on what the application caches and on whether the service is reachable from the internet.

The issue is confirmed by connecting to TCP 11211 (or sending requests to UDP 11211) and issuing commands such as version or stats, then listing and retrieving cached items, for example with lru_crawler metadump all followed by get requests. Scanners report it as an accessible Memcached service and, where UDP responds, as a service that can be abused for amplification.

Remediation

Limit the service to the hosts that use it:

  • Bind Memcached to the loopback address or a specific internal interface with the -l option, and disable UDP with -U 0 unless it is genuinely required.
  • Restrict TCP 11211 with network and host firewall rules so that only the application servers that use the cache can connect, and block TCP and UDP 11211 at the perimeter.
  • Where the cache must be reached across a less trusted network, enable SASL authentication and TLS in builds that support them, or carry the traffic through an encrypted tunnel.
  • Avoid storing secrets in the cache where the application allows it.
# /etc/memcached.conf (Debian and Ubuntu) -l 127.0.0.1 -U 0 # /etc/sysconfig/memcached (Red Hat family) OPTIONS="-l 127.0.0.1 -U 0"

Confirm the fix by sending requests to TCP and UDP 11211 from an untrusted network and checking that no response is received.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding