Glossary
Memcached DDoS Attack

Memcached DDoS Attack

Rostyslav Pidgornyi

Your website, app, or online service is working fine one minute and then suddenly, it's flooded with traffic. But this traffic isn’t coming from real users; it’s from malicious actors who have hijacked servers to send massive amounts of data your way. 

This is what happens in a Memcached DDoS attack. Let’s break down what these attacks are, how they work, and most importantly, how you can protect your systems from falling victim to them.

What is a Memcached DDoS Attack?

A Memcached DDoS attack is a type of distributed denial-of-service (DDoS) attack that leverages the vulnerabilities of Memcached servers. Memcached is a popular caching system used to speed up database-driven websites by storing data in memory to reduce latency. 

However, if these servers are not secured properly, attackers can exploit them to amplify their attacks, sending an overwhelming amount of traffic to a target and crashing the victim’s services.

Memcached DDoS attacks are especially dangerous because they can amplify the amount of traffic, using techniques like DDoS booters by as much as 51,000 times, making even small botnets capable of generating massive attack volumes.

Here are the most infamous Memcached DDoS attacks recorded based on their impact:

Date Target Traffic Volume (Gbps/Tbps) Duration of Attack Key Takeaways
Feb 2018 GitHub 1.35 Tbps 8 minutes Largest recorded Memcached DDoS attack at the time
Mar 2018 US-based Service Provider 1.7 Tbps Several hours Highlighted vulnerabilities in open Memcached servers

Most DDoS attacks, including those leveraging Memcached, are short in duration but high in intensity. On average, more than half of all attacks last between 5 to 15 minutes. However, larger-scale attacks can last hours or even days depending on the target and the vector used, and are constantly on the high.

How Does a Memcached DDoS Attack Work?

Let’s walk through how a Memcached attack actually works.

Memcached servers rely on the Memcached protocol, which is meant to provide quick responses to legitimate user requests by caching database queries in memory. The problem occurs when these servers are left exposed to the public internet without proper security. 

When a server is open, an attacker can send forged requests to the Memcached server that appear to be coming from the victim’s IP address rather than their own. This is where IP spoofing comes into play.

Here’s what happens in more detail:

  1. Sending a Spoofed Request
    Attackers take advantage of a common network communication protocol called UDP (User Datagram Protocol), which is designed for fast data transmission. Unlike TCP, which requires a handshake to establish a connection, UDP does not verify the sender. This makes it vulnerable to IP spoofing—where the attacker’s request looks like it’s coming from the victim’s IP address.
  2. Reflection
    The server, thinking the request is legitimate, responds by sending data back to the victim's IP address. This is what’s known as a reflection attack. The Memcached server reflects the data to the IP address of the target (the victim), who never actually made the request in the first place.
  3. Amplification
    This is where the real damage comes in. In a Memcached DDoS attack, the amount of data sent back is much larger than the request itself. A small 15-byte request can trigger a response that’s up to 750KB, or even more, in size. This amplification effect is so significant that attackers can multiply their impact by up to 51,000 times. A few requests turn into a deluge of massive data responses.
  4. Flood of Data
    Once the attack is underway, thousands or even millions of these forged requests are sent to Memcached servers, all of which respond by flooding the victim’s IP address with massive amounts of traffic. The victim’s systems become overwhelmed, and their resources—like bandwidth, servers, and firewalls—can’t handle the load. This results in slowdowns, crashes, or a total service outage.
  5. Layered Impact
    These attacks typically target the Network Layer (Layer 3) and Transport Layer (Layer 4) of the OSI model, causing the infrastructure to collapse under the volume of incoming data. However, the attack can also impact the Application Layer (Layer 7), degrading the actual user experience, causing pages to load slowly or not at all.

Multiply this by thousands or even millions of requests, and you can see how the victim becomes overwhelmed with traffic. This overloads their resources, causing slowdowns, crashes, and potential loss of service.

‍{{cool-component}}‍

Reflection vs. Amplification in Memcached DDoS Attacks

Memcached DDoS attacks are a combination of two powerful techniques: reflection and amplification. Understanding both components is essential to grasp the severity of these attacks.

  • Reflection occurs when an attacker manipulates a Memcached server into sending a response to a different target. This is done by spoofing the victim's IP address in the request, making the server "reflect" the response back to the victim, who never actually initiated the request. This trick forces the server to unwittingly bombard the target with data.
  • Amplification takes this attack to another level by dramatically increasing the size of the response. A small request, which might be as small as 15 bytes, can result in a massive response, potentially up to 750KB. This disproportionate response is what makes Memcached amplification so dangerous—it allows attackers to send vast amounts of data with minimal effort. The lack of built-in authentication within the Memcached protocol contributes to its vulnerability, as attackers can repeatedly leverage this amplification effect.

When these two techniques are combined, the Memcached server becomes a powerful tool for cybercriminals, who can launch high-impact DDoS attacks with relatively few resources. 

The target is left overwhelmed, as the attack exploits both the reflective nature of the server’s communication and the enormous amplification effect to cause disruption.

The Impact of Memcached DDoS Attacks

The impact of a Memcached DDoS attack can be devastating, especially if you rely on online services or host a website that depends on consistent uptime. Here are some potential consequences:

  1. Service Disruption: Your website or application can become inaccessible, leading to a loss of revenue, especially for e-commerce sites or businesses relying on continuous online services.
  2. Increased Latency: Even if the attack doesn’t take your site down entirely, it can lead to significant delays in processing requests. Higher Memcached latency can frustrate users, leading to a poor user experience and potential customer loss.
  3. Reputation Damage: A service outage or slowdowns due to a Memcached DDoS attack can hurt your company’s reputation. Customers expect reliability, and when a website goes down, it raises concerns about security and trustworthiness.
  4. Costly Overhead: Handling and mitigating the aftermath of a DDoS attack can be expensive. From hiring security experts to upgrading infrastructure, the financial cost can quickly add up.

Here’s how a Memcached DDoS attack scales up quantitatively:

Attack Component Example Value Effect
Amplification Factor Up to 51,000x Small requests generate massive responses
Data Response Size (Single) 750 KB per request Floods victim's bandwidth with oversized data
Number of Requests in Large Attack Millions of requests per minute Causes severe service disruption and resource overload
Potential Traffic Volume 1-2 terabits per second (Tbps) Can overwhelm even large, well-protected networks

How to Prevent and Mitigate Memcached DDoS Attacks

The good news is that there are ways to protect yourself from these types of attacks. While there is no foolproof method, following these best practices can significantly reduce your risk.

  1. Secure Your Memcached Server: First and foremost, make sure your Memcached servers are not exposed to the internet. Configure them to only accept traffic from trusted sources within your network. Implementing access control lists (ACLs) or firewall rules can prevent unauthorized access.
  2. Disable UDP Protocol: The majority of Memcached DDoS attacks exploit the UDP (User Datagram Protocol), which is a connectionless communication protocol. Disabling UDP support and relying on TCP instead can reduce your exposure to these attacks. UDP allows for faster communication but is more vulnerable to spoofing.
  3. Rate Limiting: Implement rate-limiting techniques to control the amount of data a single IP address can request from your servers. This way, even if an attack is launched, it will be throttled.
  4. DDoS Protection Services: Consider investing in a DDoS protection service that can detect and mitigate attacks in real time. These services can absorb the flood of traffic and prevent it from reaching your systems. Cloud-based services like Cloudflare or Akamai offer this type of protection, which can shield your site from even large-scale DDoS attacks.
  5. Network Monitoring: Regularly monitor your network traffic for unusual patterns or spikes in traffic. Identifying an attack early can give you valuable time to mitigate the damage before it takes down your service.
  6. Patch and Update Regularly: Make sure that your Memcached servers are always running the latest software versions. Patches are often released to fix security vulnerabilities that could be exploited in a DDoS attack. Keeping everything updated reduces your risk.

Conclusion

Memcached DDoS attacks are a serious threat, but with the right preventative measures, you can significantly reduce your risk of falling victim to one. Knowing how these attacks work, how they exploit the Memcached protocol, and the difference between reflection and amplification can help you better prepare.

Published on:
October 29, 2024
This is some text inside of a div block.