Module 16 · Cost-Based Denial of Service

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 27, 2026
4 min read
Read as

Last updated: April 29, 2026

100% Free

No signup. No paywall. No catch. One of our 10 most-requested practitioner modules — published in full so anyone can learn for free. We earn through consulting, not by gating knowledge.

See all 10 free modules →

Why this module exists. Modern cloud architectures auto-scale. Auto-scaling means an attacker who can drive load can drive your bill — to bankruptcy levels — without taking the service down. The 2020-2024 wave of “DenialOfWallet” attacks demonstrated that autoscaling without circuit breakers is a financial DoS.

Why this module exists. Modern cloud architectures auto-scale. Auto-scaling means an attacker who can drive load can drive your bill — to bankruptcy levels — without taking the service down. The 2020-2024 wave of “DenialOfWallet” attacks demonstrated that autoscaling without circuit breakers is a financial DoS. Indian SaaS, especially YC-funded startups with low cash runway, are highly exposed.

How autoscaling becomes a weapon

Your serverless function executes 1ms-100ms each. Your Lambda cost is fractions of a paisa per invocation. Throughput limit: thousands of concurrent invocations.

Attacker generates 100M invocations over 24 hours. Total cost: ₹3,000-30,000. Their cost: ~₹50 of botnet rental. Their incentive: extortion, vendetta, or just to watch.

For services with bandwidth costs (CloudFront egress, S3 GET, RDS data transfer): even simpler. Each request is HTTP-cheap; egress is paid in GB. Drive 10TB of egress = $900 (at AWS prices). Drive 100TB = $9,000. Sustained over a month = $270K.

Cost-DoS attack patterns

1. Lambda pump

Lambda invocations are billed per-100ms with concurrency limits. Attacker discovers an internet-reachable Lambda (via API Gateway). Fires 1,000 RPS for hours. Bill goes from ₹100/day baseline to ₹50,000/day.

2. CloudFront / CDN egress

Attacker requests large files from your CDN through different cache keys to bust cache. Each cache miss hits origin = origin egress cost. Each cache hit = CDN egress cost. Both are expensive at scale.

3. S3 bucket flood

S3 bills both per-request and per-byte. HEAD bucket repeatedly: 0 bytes egress, but $0.40/million requests. 1 billion HEAD requests = $400 plus the cost of you noticing.

4. Storage growth via uploaded data

Upload feature without limits: attacker uploads 100GB of files. Recurring monthly cost. Less critical (storage is cheap), but adds up.

5. ML inference pumping

Bedrock, OpenAI, Vertex AI charges per token. App with a public LLM endpoint: attacker pumps prompts. ₹100K/day is achievable in less than a day of unauthenticated calls.

6. RDS / database connection pumping

Connection storms drive RDS to scale. Aurora Serverless v2 auto-scales ACU upward; bill follows. Even non-serverless RDS bills more during spike.

The defender’s three concentric circles

Circle 1: rate limiting at the edge

Cloudflare, CloudFront, ALB-level rate limits. Per IP, per ASN, per fingerprint. Set tight limits early; relax for legitimate users via auth gating.

Circle 2: budget circuit breakers

  • AWS Budgets with alarm + auto-action. Email at 80% of monthly budget, programmatic action at 100% — like attaching a deny-all policy to the production role.
  • API Gateway throttling per route, per API key.
  • Lambda reserved concurrency caps total parallel executions for a function. Attacker can’t exceed it.
  • WAF rate-based rules trigger Lambda function + email + Slack on threshold breach.

Circle 3: architecture-level cost ceiling

  • Authentication required on cost-significant endpoints.
  • API key tier with quotas.
  • “Free tier” features distinct from paid — free tier on its own infrastructure with hard caps.
  • SaaS architecture: each customer in their own tenant boundary, can’t blast each other’s quota.

Real-world cases

  • “Denial of wallet” research 2020-21 — academic and industry papers documenting practical attacks against AWS, Azure, GCP autoscaling.
  • Multiple disclosed bug-bounty reports describing public Lambda functions, public ML inference endpoints, public CDN-served large files used for cost amplification.
  • 2023 Vercel / Cloudflare incidents — bot armies driving bills on customer accounts; Cloudflare implemented per-account anomaly detection and customer alerts in response.

Try this yourself

# Set a budget alarm in your AWS account NOW
aws budgets create-budget 
  --account-id $(aws sts get-caller-identity --query Account --output text) 
  --budget '{"BudgetName":"daily-circuit","BudgetLimit":{"Amount":"100","Unit":"USD"},"TimeUnit":"DAILY","BudgetType":"COST"}' 
  --notifications-with-subscribers '[{"Notification":{"NotificationType":"ACTUAL","ComparisonOperator":"GREATER_THAN","Threshold":80},"Subscribers":[{"SubscriptionType":"EMAIL","Address":"[email protected]"}]}]'

# Cap Lambda concurrency
aws lambda put-function-concurrency 
  --function-name MyPublicAPI 
  --reserved-concurrent-executions 50

# Enable WAF rate-based rule on API Gateway
# (via console or Terraform — limit 2000 req/5min per IP)

# Audit your highest-cost services
aws ce get-cost-and-usage --time-period Start=2026-04-01,End=2026-04-28 
  --granularity DAILY --metrics BlendedCost 
  --group-by Type=DIMENSION,Key=SERVICE

Defender’s checklist

  • Daily budget alerts with auto-action on the production account. Email at 50%, 80%; programmatic action at 100%.
  • Reserved concurrency on every internet-reachable Lambda. The cap should reflect business need, not technical max.
  • Per-IP rate limits on every authenticated and unauthenticated endpoint. Tighten for unauthenticated.
  • Per-account AWS Org SCP — ec2 instance type restrictions, region restrictions. Attacker who pivots can’t spin up p4d.24xlarge or use Brazil region.
  • Anomaly detection — AWS Cost Anomaly Detection or your own metric on cost growth-rate. Alert on hourly delta vs baseline.
  • Authentication on AI / ML endpoints. Token-quota per user. Explicit pricing at the API level.
  • Tabletop exercise: “We just got a $50K AWS bill spike. Who has the runbook?” Most teams don’t have one.
🧠
Check your understanding

Module Quiz · 6 questions

Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.

Want this for your team?

Custom team training + practitioner advisory

Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.

Book team training call Replies in 4 working hrs · India-only · Senior consultants