SMS pumping fraud: when bots attack your OTP endpoint
Short answer
SMS pumping fraud, also called SMS toll fraud or artificially inflated traffic, is when bots use a form that sends text messages, usually a one-time code, to trigger thousands of messages to number ranges the attacker profits from. The attacker takes a share of the fees operators charge to deliver them, the site pays the SMS bill, and no code is ever entered.
Any endpoint that sends a text message on request can be a target: phone verification at signup, login codes, password reset, "text me a download link" forms and order updates. Each message sent earns the attacker money, so the bot never finishes the signup or enters the code.
How does SMS pumping fraud work?
Delivering a text message to a mobile network costs a termination fee, which the sender's provider pays along the route. Twilio's glossary entry on SMS pumping describes two setups. In one, the mobile network operator that controls a block of numbers is complicit and shares the revenue with the fraudster. In the other, the operator is unaware: smaller operators are paid by larger ones for incoming traffic, and the fraudster, posing as a business, promises them high volumes. Either way, the attacker gains when messages reach numbers in that range, often in destinations where delivery is expensive.
The bot then does the rest:
- It finds a form or API that sends an SMS to any number entered, without checks.
- It submits numbers from the attacker's ranges, often sequential, at high volume.
- Your SMS provider delivers each message and bills you at the destination's rate.
- Nobody ever enters a code, because nobody is there to read it.
If your flow falls back to a voice call when SMS fails, the same attack works with calls, which can cost more per attempt.
Why do bots target OTP endpoints?
A send-code endpoint is public, needs no login, is cheap to call and triggers an action you pay for. The OWASP API Security Top 10 (2023) describes this class of problem as unrestricted access to sensitive business flows. Many sites put strong bot checks on the login form and none on the "resend code" button next to it.
Signs of SMS pumping in your logs
- Messages to countries you do not serve, or a sudden share for a country that is usually small.
- Many numbers with the same prefix, often in sequence.
- A drop in the share of sent codes that are verified, for one country or prefix.
- Bursts outside your normal traffic pattern, with repeated resends to numbers that never complete signup.
- A spending alert or a fraud notice from your SMS provider.
The verification rate is the most useful single number. Real users who ask for a code mostly enter it. Pumped numbers never do. This PostgreSQL query ranks the last day's traffic by country and prefix, assuming an otp_sends table with phone_e164, country_code, sent_at and a nullable verified_at:
SELECT country_code,
left(phone_e164, 7) AS prefix,
count(*) AS codes_sent,
count(*) FILTER (WHERE verified_at IS NOT NULL) AS codes_verified,
round(100.0 * count(*) FILTER (WHERE verified_at IS NOT NULL) / count(*), 1) AS verified_pct
FROM otp_sends
WHERE sent_at >= now() - interval '24 hours'
GROUP BY country_code, left(phone_e164, 7)
HAVING count(*) >= 20
ORDER BY verified_pct ASC, codes_sent DESC
LIMIT 50;Compare each row with the same country's rate over the previous month. A prefix with many sends and almost no verifications is the pattern to act on.
How to stop SMS pumping
Put bot detection in front of the send-code endpoint. Require a passed check, such as an invisible challenge or a good bot score, before any message goes out, and verify it on the server. Never send a code on page load.
Rate limit on several keys at once. Per IP address is the easiest and the weakest, since bots rotate addresses. The limits that hurt pumping are per phone number, per number prefix and per session or device. As a starting point, allow three sends per number per hour and five per day, three per session, and alert when any prefix exceeds its usual daily volume several times over. At the edge, a Cloudflare rate limiting rule can count requests per IP address to the endpoint with an expression like this, while the per-number limits live in your application:
(http.request.uri.path eq "/api/verify/send" and http.request.method eq "POST")Add delays between resends. A first resend after 30 seconds, then 60, then 120, costs a real user little and slows a bot down sharply.
Allow only the countries you serve. SMS providers such as Twilio let you switch destinations on or off, and a country you never sell to should never receive your codes. If you serve many countries, use lower limits for destinations that cost more to reach.
Check the number before sending. Phone number intelligence services can tell you whether a number is mobile, landline or VoIP and which carrier holds it, so you can refuse number types that cannot receive a verification code anyway.
Monitor the verification rate per country and prefix, as in the query above, and pause sending to a prefix automatically when its rate falls far below normal.
Turn on your provider's fraud controls and set spending alerts. Twilio Verify, for example, has Fraud Guard, which blocks destination prefixes that show suspicious traffic patterns, alongside geographic permissions.
Finally, ask whether the flow needs SMS at all. Email codes, authenticator apps and passkeys cost nothing per use, and stronger options than SMS also protect accounts better. The same form-abuse problem appears with email in subscription bombing, and the API-level defences are in how to protect APIs from bots.
Tools that help
StopBots is published by Kairal, which is one of the tools listed. The list is not a ranking.
- Twilio Verify sends and checks one-time codes, with Fraud Guard and geographic permissions to block pumped destinations.
- Telesign provides SMS and voice verification APIs plus phone number intelligence you can use to assess a number before sending.
- Cloudflare Turnstile is a free challenge you can require before the send-code request, with a server-side token check, which is enough for many small sites.
- Kairal lets you set protection per endpoint, so the send-code endpoint can get bot detection and invisible challenges before any message is sent.
Common questions
What is the difference between SMS pumping and IRSF?
International revenue share fraud (IRSF) is the older voice version: calls generated to international numbers whose operators share the call revenue with the fraudster. SMS pumping applies the same model to text messages, and a voice fallback on your OTP flow exposes you to both.
Does a CAPTCHA stop SMS pumping?
It raises the cost, but solving services clear puzzles cheaply and the attacker's revenue per message can cover that. Combine any challenge with per-number and per-prefix limits and conversion monitoring.
Who pays for SMS pumping?
The business that sends the messages. Its SMS provider bills each message at the normal rate for the destination, so the cost appears on the next invoice unless spending alerts or a fraud guard stop it earlier.