r/webdev • • 3d ago

Discussion Got hit by an SMS pumping attack today that burned my balance in 20 minutes

Got an auto-recharge email from my SMS provider today, followed by a second one a few minutes later. The projects on that account only get a handful of real signups a day, so burning through a full top-up out of nowhere made no sense.

First thing that threw me off: the regular programmable SMS log was completely empty. Zero messages from today. Dedicated OTP verification APIs keep their own separate attempt logs outside the standard SMS log, and that's where everything was sitting.

One single user account had fired nearly 90 verification SMS requests in about 20 minutes. 0% conversion, sequential numbers in expensive international corridors ($0.30 to $0.75 per text).

I already had rate limits on that endpoint, per phone number and per IP. What I was missing was a per-user limit, a global circuit breaker, and any check on destination SMS cost. So the attacker took one account, sent 5 texts to 5 sequential numbers, hit the IP limit, rotated to a new residential proxy IP, and sent 5 more. Five texts, one IP block, new IP, repeat. Meanwhile the provider's built-in fraud guard was enabled at its default "Standard" level and let every single one of them through.

Two other things that surprised me:

  1. Delayed settlement makes it look like your fix failed. International SMS charges take a few minutes to settle, so my balance kept dropping and triggered another auto-recharge after the attacker had already stopped. Checking the latest attempt timestamp instead of watching the balance was the only reliable signal.
  2. Shared provider credentials multiply the blast radius. Auditing every other project sharing that same SMS account turned up another signup endpoint with no rate limits at all, plus a test that had been hitting the live verification API on every CI run.

What actually closed it: per-user (hourly + daily) + per-phone + per-IP + global circuit breaker (in that order, with a destination SMS price cap checked before incrementing the global counter so one attacker can't DoS legitimate users), flipping phone verification to inbound messaging where the user sends a code to us for $0, maxing out carrier fraud guard, disabling unused channels (voice verification was wide open globally by default), and tightening geo permissions.

Anyone else run into this? Curious if carrier support actually refunds SMS pumping charges when their default fraud guard misses it.

0 Upvotes

24 comments sorted by

24

u/mq2thez 3d ago

Can you ask the AI that wrote this to include a TLDR next time?

-22

u/uriwa 3d ago

You are confused, that's what you ask from your AI

11

u/mq2thez 3d ago

So you want me to waste money to read this wall of text?

-10

u/uriwa 3d ago

You literally don't have to do anything

9

u/mq2thez 3d ago

Did you, or is it all prompts?

1

u/Complete_Stay_5601 3d ago

90 texts at $0.30 to $0.75 is $27 to $67 total. That drained a full top-up and triggered two auto-recharges? What was the recharge threshold set at, like $20?

1

u/Tricky-Oil6826 3d ago

0% conversion on 90 verification texts and your fraud detection was an auto-recharge email. "Standard" level doing exactly what it says on the tin.

1

u/Aide_Sea 3d ago

Honestly I'd just turn auto recharge off for an account that only sends a few texts a day, or cap it at one per day. Then the worst case is a single top up, not an open tab.. A low balance alert can do the job the recharge email was doing anyway :)

1

u/imhongst 3d ago

one thing i'd add to the per-user limit: put a guard on the provider side too, not only in your code. most SMS providers let you turn off countries you don't actually serve and set a spend alert, so if your rate limiting has a hole again the bill still can't run away in 20 min. also worth asking if signup really needs SMS at all. email first and phone later cuts a lot of this.

1

u/Official_BetterSWE 3d ago

one signal worth alerting on is verify rate: codes sent vs codes actually entered, per hour and per country prefix. real signups usually enter the code, pumping sits near 0, so a drop below some floor can trip the breaker before the balance does. sequential numbers are easy to catch too, if recent requests only differ by +1 in the last digits thats not people

1

u/AhmedAmer2nd 2d ago

Thanks for writing up the details. The separate OTP log catches a lot of people out. Something else worth adding: an allowlist of countries you actually serve. Most pumping goes through expensive international routes, so blocking countries you don't serve kills most of it. A daily spend cap with an alert on the provider side gives you a hard backstop when your app-level limits miss something.

-9

u/uriwa 3d ago

Wrote up a longer version of what happened and the exact guardrail order here: https://uriv.me/blog/sms-pumping-in-20-minutes

2

u/NicelyAbounding 3d ago

Carriers refunding anything is a fantasy I gave up on years ago.

1

u/[deleted] 1d ago

[removed] — view removed comment

1

u/webdev-ModTeam 1d ago

Your post/comment has been determined to be a low-effort post or comment. This includes title-only posts, easily searchable questions, vague/open-ended discussion prompts, LLM generated posts or comments, and posts/comments that do not provide enough context for meaningful replies or discussion.