Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

My text message codes cost far more than they should

Short answer

Every one-time code is a paid message, so the bill follows how many codes your app requests, not how many customers you have. Check for a sudden spike first, because attackers can script code requests. Then limit requests per number and device, and offer a cheaper channel where it makes sense.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • The messaging bill is higher than my number of real customers justifies.
  • The provider sent a usage or fraud warning.
  • Users get several codes in a row or cannot receive them.
  • A spike in codes sent to countries where I have no customers.
  • I am paying for codes sent to people who never finish signing in.

Why does this happen?

  1. Each code is one paid message

    The provider charges per message. Anything that makes the app send more codes raises the bill, including retries, resend buttons and repeated login screens.

  2. Attackers can script the request

    OWASP gives this very example: a forgot-password flow sends an SMS through a provider that charges per message, and an attacker scripts the request tens of thousands of times, so the company loses a lot in minutes.

  3. There is no cap per person or per number

    OWASP's prevention advice is to rate limit, to limit how many times one user can run a sensitive action such as requesting a code, and to set spending limits with service providers or billing alerts.

  4. Phone auth providers set their own limits

    Firebase documents quotas for verification SMS per day, per IP address and per hour, and says abuse protections may be enabled without warning on accounts with suspicious traffic. Check your own provider's page for its numbers.

What can I do about it today?

  1. Open the provider's usage reportLook at messages per day and per country. A sharp jump to one country or hour is a sign of abuse, not growth.
  2. Set a spending limit or alertMost providers allow a budget alert. OWASP recommends spending limits or billing alerts with service providers.
  3. Do not switch OTP offThat could lock real customers out or leave signup unprotected. Ask your developer to add limits instead.
  4. Ask what happens when a user taps resendYour developer should be able to tell you how many codes one phone can ask for and how fast.
  5. List where codes go toCheck whether the app sends codes to countries you do not serve.

When should I bring someone in?

  • The bill rose sharply in a short time.
  • Your provider has flagged or paused your account.
  • Real users are not receiving their codes.

How do I handle it?

  1. Read the sending patternFrom provider reports and server logs I separate real customers from scripted requests.
  2. Add limits where the code is requestedA cap per number, per device and per address, with a sensible wait between resends.
  3. Confirm the request is from your appApp attestation and a quiet check before a code is sent, so scripts cannot ask for codes freely.
  4. Restrict the destinationsCodes are allowed only to the countries you serve.
  5. Offer other ways to log inEmail links, passkeys or sign in with Apple or Google can replace some texts, if it fits your users.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Can you tell me how much I will save?

No, because it depends on how much of the bill is abuse. I can show you the breakdown from your own reports after looking at them.

Is email cheaper than SMS?

Usually, since it is not charged per text by a carrier. Whether email login suits your customers is a product decision.

Will limits make real users unhappy?

Limits are set so a normal person never hits them. A real person tapping resend a few times is allowed.

Is this the same as bots signing up?

Related, but this page is about the bill for one-time codes. The page on fake accounts covers the wider signup problem.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.