Door 10 - Unbounded Consumption

Back
Door 10OWASP - LLM10:2025
Why You Need to Know This
ATTENTION

A startup launches their AI assistant with pay-per-token pricing. Within days, their cloud bill jumps from $3/hour to $3,000/hour. No spike in legitimate users – just a handful of accounts sending prompts like “Explain quantum physics in 50,000 words” and “List every prime number.” Each request looks harmless to content filters but consumes 1000× the resources of a normal query. By the time the team notices, they’ve burned through their monthly budget in 72 hours. The attacker didn’t need to hack anything – they just asked the model to think harder.

What You Will Learn
OBJECTIVES

By the end of this module, you will be able to:

  • Explain how Model DoS differs from traditional DDoS attacks and why LLM inference is uniquely expensive to attack.
  • Identify attack vectors including sponge attacks, AutoDoS optimization, context stuffing, and recursive tool-use loops.
  • Apply multi-layered defenses combining rate limiting, timeout enforcement, cost monitoring, and semantic input validation.
  • Evaluate systems against the security checklist to prevent denial-of-wallet and service degradation attacks.
TL;DR
AT A GLANCE

Unbounded consumption occurs when LLM applications allow excessive and uncontrolled inferences, leading to resource exhaustion, economic denial-of-wallet attacks, and service degradation for all users.

- OWASP LLM10:2025 Unbounded Consumption

Model DoS exploits the 1000× cost multiplier of LLM inference versus traditional web services. Sponge attacks – benign-looking prompts that trigger 10-200× resource consumption – bypass traditional defenses and can escalate costs from $3/hour to $3,000/hour.

What Is Model Denial of Service?
DEFINITION

Understanding the $3,000/hour scenario requires recognizing what makes LLM attacks fundamentally different from traditional denial-of-service.

Model Denial of Service (Model DoS) exploits the computational expense of LLM inference. Unlike traditional DDoS attacks that flood networks with junk packets, Model DoS uses legitimate-looking prompts that force the model into resource-intensive operations – massive output generation, infinite tool-call loops, or complex reasoning chains.

The attack is particularly effective because LLM inference is inherently expensive: generating a single response can consume 10,000-100,000× more compute than serving a static webpage. An attacker needs only script dozens of “sponge” prompts to exhaust GPU capacity or burn through an API budget.

DeepSeek-R1 reasoning models are highly susceptible to exhaustion attacks. Simple prompts can trigger prolonged reasoning loops consuming excessive tokens. Timeout errors indicate resource exhaustion, not system failures – internal reasoning conflicts amplify vulnerability.

- Mindgard Research (February 2025)
Why It Matters
IMPACT

As LLMs power critical infrastructure – customer service, code generation, medical triage – availability becomes a security issue. Model DoS can disable services, inflate costs, or provide cover for other attacks.

  • Denial-of-Wallet (DoW): Formalized Threat. OWASP now formally recognizes DoW as a primary attack vector where adversaries exploit consumption-based pricing to drain financial resources. If you pay per token, attackers can automate thousands of long-context requests to run up costs. Research shows malicious inputs increase energy consumption and latency by 10-200×, with costs potentially escalating from $3/hour to $3,000/hour.

  • Service Degradation & Queue Saturation. LLMs have limited concurrency (GPUs are expensive). One attacker monopolizing inference capacity means legitimate users face timeouts or degraded responses – denying service to paying customers while inflating operational costs.

  • Cascading Failures. Research demonstrates a single optimized prompt can increase latency 250×, causing timeout cascades across dependent services (chatbots, RAG systems, agent workflows).

  • False Positive Exploitation: 97% Block Rate. Research demonstrates attackers can exploit false positives in LLM safeguards to launch denial-of-service attacks. By inserting adversarial prompts as short as 30 characters, attackers trigger safety systems to mistakenly block legitimate content, achieving 97% rejection rates on systems like Llama Guard 3. This turns security measures into attack vectors.

  • Context Window Exhaustion. Flooding the context with garbage pushes out system instructions, degrading safety alignment or enabling prompt injection attacks as a secondary payload.

Understanding these risks requires examining the three interconnected attack surfaces that make LLM systems vulnerable.

The Three Attack Surfaces
FUNDAMENTALS

Model DoS attacks exploit three interconnected layers of LLM systems. Based on patterns described in OWASP LLM10:2025 and related research, we can categorize these attack surfaces as follows:

  1. 01
    Compute Layer: Inference Cost Exploitation

    LLM inference is inherently expensive –10,000-100,000× more compute than serving static content. Attackers craft prompts that maximize GPU utilization: long outputs, complex reasoning, or repetitive patterns. Unlike bandwidth exhaustion, a single well-crafted prompt can monopolize resources that would otherwise serve thousands of legitimate users.

  2. 02
    Economic Layer: Denial-of-Wallet

    Pay-per-token pricing creates a direct attack vector. Each token generated costs money, and consumption-based models let attackers externalize costs to their victims. A coordinated campaign of expensive prompts can drain budgets without any technical exploitation – the billing API works as designed.

  3. 03
    Service Layer: Queue Saturation

    GPUs have limited concurrency. When inference queues fill with resource-intensive requests, legitimate users face timeouts regardless of available budget. Cascade effects spread across dependent services – chatbots, RAG systems, and agent workflows all fail when the underlying LLM becomes unresponsive.

With these attack surfaces in mind, let’s examine the specific techniques attackers use to exploit them.

Taxonomy of Attacks
ATTACK VECTORS

Attacks exploit various aspects of LLM resource consumption – inference time, token generation, tool use, and reasoning loops. Each category targets different vulnerabilities in the system architecture.

Semantic Exploitation (Detection: Hard)

  • Sponge Attacks (Benign-Input DoS). Prompts that appear harmless but trigger exponential resource use. Examples: “Explain the concept of infinity in 50,000 words” or “List all prime numbers.” Unlike traditional DoS, these bypass content filters and rate limiters because they look legitimate. Standard WAF rules don’t detect semantic resource exhaustion.

  • AutoDoS (Automated Optimization). Research introduced an algorithm that constructs DoS Attack Trees, automatically optimizing prompts for maximum resource consumption across black-box models. Uses “Length Trojan” embeddings to bypass defenses.

Training-Time Attacks (Detection: Very Hard)

Agentic System Exploitation (Detection: Medium)

  • Recursive Tool-Use Loops. For agentic systems, prompts like “Keep searching until you find the answer” can trigger infinite tool-call chains (web search → summarize → search again → …), consuming API quotas and compute.

Resource Flooding (Detection: Easy)

  • Context Stuffing. Uploading massive documents (PDFs, code repositories) to force the model to process millions of tokens per request. Combined with multi-turn conversations, this exhausts context windows.

  • Variable-Length Input Floods. Sending numerous inputs of varying lengths to exploit inefficiencies in batching and resource allocation, causing queue congestion.

Real-World Incidents
CASE STUDIES

Research Demonstrations

  • AutoDoS Black-Box Attack (2025). Crabs research demonstrated 250× latency increase using automated prompt optimization against commercial LLMs. A single optimized prompt could cause cascading timeouts across multi-agent systems, proving that DoS attacks can be systematically automated even without model access.

  • GPT-4o P-DoS Demonstration (2024). Research showed that injecting one poisoned fine-tuning sample caused the model to generate 16,000-token repetitive outputs (vs. 500 tokens normally), proving that training-time attacks can create persistent DoS vulnerabilities that survive into production.

  • False Positive DoS: 97% Blocking Success (2024). Research demonstrated attackers can exploit LLM safeguard mechanisms to achieve denial of service by triggering false positives. By inserting adversarial prompts as short as 30 characters into user requests, attackers caused Llama Guard 3 to mistakenly block over 97% of legitimate user requests – turning safety systems into attack vectors.

Reasoning Model Vulnerabilities

  • DeepSeek-R1 Exhaustion (February 2025). Testing revealed DeepSeek-R1’s reasoning models are easily manipulated into prolonged loops by simple prompts. Attackers embed malicious payloads to distract reasoning, bypassing safeguards. Timeout errors confirmed resource exhaustion vulnerability, demonstrating that reasoning models are particularly susceptible to DoS through internal reasoning conflicts.

Economic Impact

  • Denial-of-Wallet Cost Impact. Real-world cases documented costs escalating from $3/hour to $3,000/hour due to unbounded consumption attacks, where attackers gained unauthorized access to LLM APIs and drained organizational budgets through resource exhaustion.

Defense Strategy Tiers
SECURITY CONTROLS

Defense requires multi-layered protection across rate limiting, input validation, resource quotas, and anomaly detection. No single defense suffices against sophisticated Model DoS attacks.

Tier 1: Essential (Implement First)

  1. 01
    Rate Limiting & Quotas

    Implement tiered rate limits: X tokens/minute for free users, Y for paid. Track cumulative token usage over rolling windows. Set hard limits on context window size (e.g., max 100k tokens/request). Use exponential backoff for repeated long requests from the same source.

  2. 02
    Timeout & Circuit Breaker Patterns

    Set aggressive timeouts for inference (e.g., 30 seconds). If a request exceeds budget, terminate gracefully and return cached response or error. Implement circuit breakers: if timeout rate exceeds threshold, temporarily block the user/IP.

Tier 2: Standard (Production Hardening)

  1. 03
    Cost-Based Abuse Detection

    Monitor cost per request. If a single user’s average cost exceeds 10× the median, flag for review. Detect patterns: repeated long outputs, tool-use loops, context stuffing. Auto-ban accounts exhibiting DoW behavior.

  2. 04
    Input Sanitization (Sponge Detection)

    Detect sponge patterns: excessive repetition requests (“repeat X 10,000 times”), unbounded generation (“write forever”), numerical exhaustion (“list all primes”). Block or rewrite these prompts.

Tier 3: Advanced (Enterprise Security)

  1. 05
    Input Validation & Length Prediction

    Research demonstrates training classifiers to predict output length from input prompts. Reject or throttle requests predicted to generate >10k tokens. Enforce max input/output token budgets.

  2. 06
    Queue Priority & Resource Isolation

    Prioritize short, low-cost requests over long ones. Use separate GPU pools for free vs. paid tiers to prevent free-tier abuse from degrading premium service. Implement fair-share scheduling.

Builder's Security Checklist
IMPLEMENTATION

Before deploying LLM applications with public access, verify these controls are in place:

For Everyone

  • Understand the Cost Model. Do you know what each inference request costs? Have you calculated worst-case scenarios for sponge attacks?

  • Budget Alerts Configured. Are spending alerts set at 50%, 80%, and 100% of your monthly budget? Is there an emergency kill switch?

For Developers

  • Rate Limits Enforced. Do you have per-user, per-IP, and per-account token budgets? Are they tested under load?

  • Timeouts Configured. Is there a hard timeout for inference (e.g., 30-60s)? Do circuit breakers kick in after repeated timeouts?

  • Input Length Limits. Do you enforce maximum context window usage (e.g., 100k tokens)? Are massive file uploads throttled?

  • Output Length Limits. Do you enforce maximum output token counts (e.g., 4k tokens)? Are streaming responses capped?

  • Graceful Degradation. Under load, does the system return cached responses or polite errors instead of crashing?

For Security Teams

  • Cost Monitoring Active. Are you tracking cost-per-request and alerting on anomalies (10× median cost)?

  • Sponge Detection Implemented. Do you block prompts with known sponge patterns (repetition loops, unbounded generation)?

  • Queue Fairness Ensured. Do premium users have dedicated resources? Is there fair-share scheduling to prevent monopolization?

  • Access Controls Configured. Is RBAC implemented? Do API keys have appropriate permission scopes and expiration policies?

The following demonstration illustrates realistic Model DoS scenarios and how defense mechanisms respond.

Interactive Simulation
LAB

This demonstration shows Model DoS attack patterns - how they affect resource consumption, latency, and cost, and how rate limiting, timeouts, and sponge detection defenses respond to each threat.

Unbounded Consumption Lab

Interactive Security Simulation

Load Scenario:
How to use: Choose a scenario and toggle security gates to see how defenses protect against different attack patterns.
1

User Request

User Prompt
2

Security Gates

Token Limits

Max context window size

Timeout Guards

Kill long-running inferences

Rate Limiting

Requests per user/IP

3

Service Status

Healthy
Request completed in 1.2s. Summary generated: "The article discusses recent advances in AI safety research..." [200 tokens] CPU: 23% | Memory: 2.1GB

Disclaimer: Client-side simulation for educational purposes. Real-world attacks may vary.

Key Takeaways
SUMMARY
  • Model DoS is Economically Motivated. Attackers exploit the 1000× cost multiplier of LLM inference vs. traditional web services. Denial-of-Wallet is as damaging as service downtime.

  • Sponge Attacks Bypass Traditional Defenses. Benign-looking prompts that trigger 10-200× resource use evade WAFs and content filters. Defense requires semantic understanding and predictive models.

  • Reasoning Models Are More Vulnerable. DeepSeek-R1 and similar systems with extended reasoning chains are easily trapped in exhaustion loops, requiring specialized circuit breakers.

  • Prevention is Multi-Layered. No single defense suffices. Effective protection requires rate limiting, timeout enforcement, cost monitoring, input validation, and queue fairness – all working together.

Further Reading
RESOURCES

Research papers, attack demonstrations, and defense strategies for protecting LLM systems against resource exhaustion attacks.

Start Here

Deep Dives

Tools & Defenses

OWASP & Industry References

Research Papers

Taxonomy & Classification

Wanna partner up or sponsor this project? Send me an email