Slide 15 of 28
Part 3 · Attack ScenariosSlide 15
Slide 15 · Scenario 2
Thousands of AI image requests. One enormous cloud bill.
OWASP Scenario #2 — no rate limit on an endpoint that triggers expensive inference.
📄 OWASP API Security Top 10 · 2023 · API4 · Scenario 2
SETUP
A startup building an AI image generation feature.

A startup builds a "generate avatar" feature using a third-party AI image generation API. Each generation costs $0.02. The startup charges users $0.05 per generation — a reasonable margin.

The API endpoint for generating an image has no rate limit per user. The assumption is that no user would generate more than a few images per day.

The exploit: A competitor (or security researcher) discovers the endpoint. They write a script to send 10,000 image generation requests over 24 hours. The startup's third-party AI bill for that day is $200 — for 10,000 images the attacker didn't pay for. At 100,000 requests, it's $2,000. At 1,000,000 it's $20,000 — potentially more than the startup's monthly revenue. The startup pays the third-party bill regardless of whether the attacker paid the startup.
This has put startups out of business

Unexpected cloud bills from API abuse are a real cause of startup failure. The $10,000-overnight-bill story is common enough in developer communities that it has a name: "getting AWS'd." Rate limiting per user per hour is the defense — not per account, not per day, because the damage can happen in hours.

← Back Scenario 3 →