Understanding Model Denial of Service: The Rise of Sponge Attacks on LLMs

April 2, 2024

The cybersecurity landscape faces an evolving threat known as “sponge attacks,” which can significantly reduce the performance of Large Language Models (LLMs). These AI systems are critical for understanding and producing human language, but sponge attacks can bring them to a grinding halt. Let’s unwrap what this means for the technological sphere and how we can fend off such attacks.

What Are Sponge Attacks?

Sponge attacks share similarities with Denial of Service (DoS) attacks, which are widely known for overwhelming systems with excessive requests, like repeatedly calling a busy phone line to ensure it remains engaged. However, their difference is that sponge attacks target AI systems more directly, introducing complex inputs that seem normal but are designed to hamstring the AI by engaging it in incredibly demanding computational tasks, akin to stuffing a sponge with water until it can’t absorb any more. Sponge attacks work by inundating AI systems with these deceptive demands, leading to several problems:

  • Intensive computing demands: LLMs, recognized for their speed and precision, face severe slowdowns as they get overwhelmed with heavy-duty computational tasks.
  • Spike in power consumption: The overloaded system uses more energy, which is taxingly similar to solving a difficult puzzle, increasing operational costs.
  • Risk of overheating: Like machinery pushed to its limits without a break, an AI system under relentless strain from a sponge attack may overheat or wear out before its time.

Model Denial of Service Mechanics

Sponge attacks exploit the fundamental mechanism that limits the amount of text processed in an LLM, the context window. Launching what is essentially a model denial-of-service through sponge attacks, these nefarious attacks overload and threaten the operational viability of numerous LLM-based applications, from real-time language translation to interactive chatbots and responsive virtual assistants. When these services slow down, the implications are widespread, potentially crippling vital business functions and obstructing the seamless communication so crucial in our fast-paced digital age.

Focusing on this attack type reveals a growing vulnerability in cloud-based AI services that could have serious consequences.

Highlighted Vulnerabilities and Attack Scenarios

Model Denial of Service attacks take various forms, each designed to hinder the functionality of LLM systems. Below, we highlight how such attacks create havoc:

  • Overloading with requests: An attacker sends many complicated requests to an AI model. The model becomes slow for other users, and the company hosting it faces high costs.
  • Tricky text traps: An LLM looking for information might hit a trap—a web page with text that seems normal but causes the LLM to make too many requests, using a lot of resources.
  • Exceeding limits: If an attacker sends more data than the LLM can handle, it can slow down the AI or stop it from working.
  • Relentless sequences: Sending many large inputs, one after another, can wear out the LLM, slow down its responses, or crash it.
  • Recursive traps: Clever inputs can force an LLM to keep trying to process and expand its workload, which can overload it and make it crash. 
  • Varied length attacks: Inputs of different sizes can push the LLM to its limit, making it harder for the AI to work properly.

Illustrating the gravity of these impacts, we can turn to an incident that disrupted the Microsoft Azure translation service. Attackers submitted carefully crafted texts that were deceptively benign in appearance and designed to sap computing power to the extreme. The service, typically known for delivering instantaneous translations, suffered massive lags, rendering responses up to 6000 times slower than usual. 

Such vulnerabilities make clear that the systems we trust can be manipulated to detrimental effect—as demonstrated by @wunderwuzzi23, who revealed how recursive calls to a plugin could significantly inflate costs for large language model services. Similarly, Harrison Chase shed light on how a solitary query to a language model app could conceivably lead to a bill surpassing the $1000 mark.

Adding to the list of cautionary tales, a recent security breach at Sourcegraph saw a malicious actor misuse a compromised admin access token. This intrusion resulted in changed Application Programming Interfaces (API) rate limits, paving the way for potential service interruptions through the possibility of abnormally high request volumes. Such manipulations underscore the precarious balance of accessibility and security in the digital realm, especially within services that form the backbone of modern communication and automation infrastructure.

Preventive Measures Against Model Denial of Service

Despite what we have just seen, there are strategies to shield AI systems from sponge attacks:

  • Input validation and sanitization: Establishing rigorous checks on user inputs ensures that the LLM processes only clean, harmless data.
  • Capping resource consumption: By limiting resources per request, the pace of executing complex tasks is controlled, preventing sudden resource drainage.
  • API rate limiting: Place constraints on how many requests a user can make within a certain timeframe to prevent abusive traffic.
  • Monitoring resource utilization: Keeping an eagle eye on how the LLM uses resources can flag unusual patterns indicative of an attack.
  • Input limits and developer awareness: Set strict input bounds based on the LLM’s capacity and raise awareness among developers about the potential vulnerabilities and defense methods for secure LLM use.

The Achilles Heel of AI systems

Machine Learning (ML) systems inherently require substantial energy. The kind of cyberattacks explored here can worsen their energy usage and compromise the integrity of the underlying systems. These attacks exploit AI’s weak spots to distort its behavior, inviting disaster. Consider smart grids managed by AI: they could suffer from signal disruptions due to such attacks, causing infrastructural damage from power oversupply or widespread blackouts. Similarly, AI-optimized city traffic systems could be thrown into disarray, leading to traffic jams, delays, and accidents if fed incorrect sensor data. Addressing these vulnerabilities to protect our AI-reliant digital framework necessitates public awareness and more resilient ML systems. 

Closing Chapter Five

And so concludes the fifth installment of our series on the top 10 LLM application security vulnerabilities. The next article will explore the LLM supply chain, from external training data to plugin extensions, pointing out possible routes to cybersecurity threats. This series aims to inform and equip the software development community with the knowledge needed to protect their LLM integrations in enterprise applications against these vulnerabilities, thus keeping them robust and secure. 

At Globant, we adopt a strict policy against cyberattacks that shield our clients when developing reliable systems. With a keen focus on the evolving landscape of LLM security, we are dedicated to exploring further and creating more insightful content in this fascinating domain in the future.

Subscribe to our newsletter

Receive the latests news, curated posts and highlights from us. We’ll never spam, we promise.

The Cybersecurity Studio focuses on reducing our clients’ cybersecurity risks. To help businesses adapt, we established a Digital Cybersecurity Framework founded by our key practices. Our value proposition considers an active participation in the software development process and a proactive view on cybersecurity solutions that include regular vulnerability tests and threat intelligence.