What a flood of traffic costs on each platform
A denial of wallet attack doesn't need to take your app down. It only needs to make every request cost you money. Our denial of wallet guide covers how the attack works; this page is about stopping it on the platforms where it hurts most.
- Cloudflare Workers: the Standard plan includes 10 million requests a month, then $0.30 per additional million, and 30 million CPU milliseconds, then $0.02 per additional million. With Workers Caching on, cached responses are billed at the same per-request rate. See Workers pricing.
- Vercel: a spend amount does not stop usage on its own. Vercel only pauses production when you turn on Pause Production Deployments, and its spend check runs every few minutes. See Vercel spend management.
- Twilio: in SMS pumping, fraudsters use a phone number field to trigger messages to numbers they profit from, and they get a share of the revenue. Twilio says these attacks inflate traffic to make money, not to steal data. See SMS pumping and toll fraud.
The brakes Costbrake has against a flood
| Platform | Brake | What it does | Undo |
|---|---|---|---|
| Vercel | Attack Challenge Mode | Every visitor must pass a browser challenge; verified bots, webhook providers and your cron jobs still get through | Restores the mode to what it was before |
| Vercel | Pause project | Production goes offline with a 503 DEPLOYMENT_PAUSED page and functions stop running | Unpauses the project, if Costbrake paused it |
| Cloudflare | CPU cap | A 50 ms CPU limit on one Worker, so expensive requests fail with error 1102; needs Workers Paid | Restores the previous CPU limit, or the 30-second default |
| Cloudflare | Spend policy block | Blocks Workers or Durable Objects on the account once this billing period's spend on it reaches $0.01, until the period ends | Puts your spend policy back, or turns off the one Costbrake added |
| Cloudflare | Detach domains | Detaches a Worker's custom domains and clears its routes, so requests on those hostnames stop reaching it | Reattaches the saved domains and routes |
| Twilio | Block high-risk voice | Turns off calling to high-risk special and toll-fraud numbers in every country where it is on | Turns it back on for exactly the countries changed |
| Twilio | Suspend subaccount | Stops one subaccount's calls, messages and API requests; the main account is never touched | Sets the subaccount back to active |
| AWS | Lambda concurrency to 0 | AWS throttles every invocation of one function, so nothing runs or bills | Restores the previous reserved concurrency |
Cloudflare has a few more: turn off a Worker's workers.dev and preview URLs, pause a queue, remove cron triggers, roll back a deployment, or turn off an R2 bucket's r2.dev URL. The spend policy block needs a Cloudflare token with Billing Edit, which you add yourself. The Cloudflare, Vercel, Twilio and AWS pages list every brake, what it does and how to undo it. If the money is leaking through a stolen key rather than traffic, see leaked API key protection.
Native controls to turn on first
- On Vercel, Attack Mode is free on all plans, and requests it blocks do not count towards your usage limits. Spend Management costs nothing extra on Pro teams; turn on Pause Production Deployments if you want Vercel to stop at your amount.
- On Twilio, disable SMS destination countries you don't use. Twilio recommends this as a line of defense against fraud, and its Verify Fraud Guard protects only the SMS channel.
- On Cloudflare, read Cloudflare spending limits for what the account can and can't cap.
Native controls work on fixed numbers and some of them run minutes behind. Costbrake adds the alert when spend moves, on one screen for every platform, and the brake for when the native setting wasn't on.
Who can pull a brake
Only admins and owners. The killswitch is off until an admin turns it on for a connection, a brake asks for the connection's label before it runs, and every request is written to the audit log first. Costbrake never brakes because a rule fired; it alerts, and a person decides.
Brakes are on Pro ($12 a month for 10 accounts) and Team ($39 a month for 50 accounts). Every new workspace starts on a 14-day Pro trial with no card, so the brakes work from the first day. See pricing.
Questions and answers
What is the fastest way to stop a denial of wallet attack on Vercel?
Turn on Attack Mode. It is free on all plans, visitors must pass a security challenge, and Vercel says requests it blocks do not count towards your usage limits. In Costbrake an admin can switch on Attack Challenge Mode from the spike alert. If traffic still costs money, the pause brake takes production offline with a 503 DEPLOYMENT_PAUSED page.
Can Costbrake stop a Cloudflare Workers bill from running away?
It can brake one, with an admin's click. The CPU cap sets a 50 ms limit on a Worker so expensive requests fail with error 1102, the spend policy block stops Workers or Durable Objects on the account once period spend reaches $0.01, and detaching domains stops requests on those hostnames. The alert comes first: on Pro and Team, Cloudflare usage is checked every minute for 2 hours after a spike.
Does Costbrake stop SMS pumping on Twilio?
It alerts on the cost spike and can suspend a Twilio subaccount, which stops its calls, messages and API requests while the main account keeps working. It does not change SMS geo permissions; Twilio recommends disabling SMS destination countries you don't use. It can also turn off calling to high-risk and toll-fraud numbers.
Will Costbrake take my site offline without asking?
No. Alerts go out on their own, but every brake waits for an admin to click it and type the connection's label. Members of the workspace can't use brakes at all.
Is denial of wallet protection on the Free plan?
Free gives spike and budget alerts by email on 2 accounts, with hourly checks, but no brakes. Pro adds 5-minute checks, faster checks during a spike, Slack, Discord and webhook alerts, and the brakes, for $12 a month or $120 a year. New workspaces get 14 days of Pro with no card.
Sources
Updated