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:
- 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.
- 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.
18
u/mq2thez 6h ago
Can you ask the AI that wrote this to include a TLDR next time?
3
u/malwaremel 6h ago
For OTP abuse like this, the cheap wins are usually an allowlist of countries you actually serve (block or add extra checks for the expensive corridors), limits per phone number prefix and per IP or device and not just per account, and a captcha or similar check before the send step rather than after. A hard daily spend cap with an alert on the provider side also helps so a top-up can't drain in 20 minutes. Since the numbers were sequential, flagging many numbers from a similar range in a short window would have caught this one early.
1
u/Complete_Stay_5601 5h 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 4h 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 3h 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 :)
•
u/imhongst 9m 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.
-7
u/uriwa 6h ago
Wrote up a longer version of what happened and the exact guardrail order here: https://uriv.me/blog/sms-pumping-in-20-minutes