how an sms pumping attack burned through my balance in 20 minutes

Earlier today I got an email saying my SMS provider had just auto-recharged my balance. That felt weird. The projects using that account get maybe a handful of real signups a day, so burning through a full top-up out of nowhere made no sense.

A few minutes later, another auto-recharge email came in.

When I first opened the regular SMS logs, there was nothing there. Zero messages from today. That threw me off for a minute until I remembered that dedicated OTP verification APIs keep their own separate attempt logs, completely outside the standard programmable SMS log.

Once I pulled the verification attempts, the picture was obvious. A single user account had fired nearly ninety verification SMS requests in about twenty minutes. Every single one was unconverted. Nobody was trying to log in. The destination numbers were sequential blocks in expensive international corridors, costing anywhere from $0.30 to $0.75 per text.

This is SMS pumping, also called artificially inflated traffic. Someone colludes with a shady carrier or aggregator, triggers OTP texts to numbers they control, and pockets a slice of the termination fee. A signup form turns into an ATM.

why my existing guardrails missed it

The annoying part is that I already had rate limits on that endpoint. Just not the right ones.

The verification handler limited requests per phone number and per IP address. There was no per-user limit, no global circuit breaker, and no check on what a destination country actually costs to text.

So the attacker took one account, sent five texts to five sequential numbers, hit the per-IP limit, rotated to a fresh residential proxy IP, and sent five more. My own anomaly alert fired on the IP rate-limit blocks, which is how the pattern showed up so cleanly in the logs. Five texts, one IP block, new IP, five more texts.

The provider's built-in fraud protection was also turned on, at its default "Standard" level. It did not stop a single one of those ninety messages.

the delayed-settlement headfake

One detail that tripped me up during the incident is that international SMS charges do not always settle immediately. Many of the attempts initially showed up with no price attached, then settled a few minutes later.

That meant even after the traffic stopped, my balance kept dropping as earlier messages finalized, which triggered a second auto-recharge while zero new messages were going out. Checking the timestamp of the latest attempt instead of staring at the balance saved me from thinking the fix had failed.

what actually closes the hole

Once the pattern is clear, the gaps are boring and straightforward.

Rate limiting an OTP endpoint on a single dimension does not hold up. Per-IP fails against residential proxies. Per-phone fails against sequential number spraying. Per-user fails if an attacker can mint throwaway accounts. Putting all four together, per-user (hourly and daily), per-phone, per-IP, and a tight global circuit breaker across the whole app, bounds the worst case even if someone automates fresh signups.

Ordering matters too. Running account eligibility checks, per-actor limits, and destination price caps before incrementing the global counter stops one attacker spraying blocked countries from burning up the global quota for real users.

Pricing checks are another big lever. Carrier APIs expose destination SMS rates, and caching them by country lets an app reject $0.75 corridors before ever calling the verification endpoint. Even better is flipping the flow entirely so the user sends a one-time code inbound from their own phone over a messaging app instead of the server paying a carrier to push an SMS out. Zero outbound cost, nothing to pump.

On the carrier side, default fraud protection is too loose. Turning it up to maximum, disabling unused channels (voice verification was wide open worldwide by default even though none of my apps use it), and locking down geographic permissions cuts off most of the expensive corridors before a request can even bill.

The last thing that almost bit me was shared credentials. Several of my other projects share the same SMS provider account. Patching the project that got hit while leaving a sibling app with zero rate limits on the exact same billing card would have been half a fix. Going through every repo on the machine that touched SMS turned up two more endpoints that needed tighter limits and even a test suite that had been quietly hitting the live verification API on every run.

Any endpoint that triggers a carrier charge on untrusted input is a payout endpoint. Treating it like one from day one is a lot cheaper than learning it from back-to-back recharge emails.

All posts