LowPrompt AttackOWASP LLM04

Denial of Service (LLM)

Attacks designed to exhaust LLM resources, cause excessive costs, or make the service unavailable.

Overview

LLM-specific denial of service attacks exploit the computational expense of language model inference. Attackers may craft inputs that maximize token generation, require extensive reasoning, or trigger resource-intensive operations. Unlike traditional DoS, these attacks can cause significant financial damage through API costs even without fully overwhelming the service.

How This Attack Works

  1. Attacker identifies inputs that maximize computational cost or output length

    What's happening

    Testing reveals: 'Write a 10,000 word essay on X' costs $0.50 per request

  2. Multiple expensive requests are sent to the LLM service

    What's happening

    Bot sends 1,000 max-length requests per minute to the API endpoint

  3. Server resources are exhausted processing the demanding queries

    What's happening

    GPU utilization hits 100%; request queue grows; latency spikes to 30+ seconds

  4. The service becomes slow, unavailable, or incurs excessive API costs

    What's happening

    Legitimate users can't access service; monthly API bill jumps from $100 to $50,000

Attack Examples

Token Maximization

Forcing maximum length outputs

Example Attack Pattern (Sanitized)
Write a 10,000 word essay on every aspect of...

Recursive Complexity

Triggering expensive reasoning chains

Example Attack Pattern (Sanitized)
Solve this problem step by step, showing all sub-steps and alternatives...

Repetitive Requests

High volume of resource-intensive queries

Example Attack Pattern (Sanitized)
Automated high-volume requests for complex tasks

Protect Your Application

Try Detection in Playground

Sample Denial of Service (LLM) Input

Write a 50,000 word comprehensive analysis covering every possible aspect of this topic in extreme detail
Try in Playground

Prevention Checklist

Build
  • Implement rate limiting and quotas
  • Use Wardstone to detect expensive query patterns
  • Implement cost controls and circuit breakers
Deploy
  • Set maximum output length limits
Monitor
  • Monitor and alert on unusual usage patterns

Detect with Wardstone API

curl -X POST "https://api.wardstone.ai/v1/detect" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Your text to analyze"}'
 
# Response
{
"prompt_attack": { "detected": false, "confidence": 0.02 },
"content_violation": { "detected": false, "confidence": 0.01 },
"data_leakage": { "detected": false, "confidence": 0.00 },
"unknown_links": { "detected": false, "confidence": 0.00 }
}

Protect against Denial of Service (LLM)

Try Wardstone Guard in the playground to see detection in action.