Why phone login stopped working in October

Summary

From Oct 22 until early November, logging in with a phone number basically didn’t work. Our monthly AWS SMS limit had run out, so no login codes were going out. The most likely reason is SMS pumping. On Oct 21, 6 phones on one network in Dhaka made about 380 phone login attempts in under an hour.

Codes were arriving again by Nov 2. Since then, each phone number can only get 5 codes a day. We tested the limit in production and it works.

Impact

Phone login actually broke twice in October. The first time was Oct 2-11. Not a single phone login went through, and 509 people tried. We haven’t figured out what caused that one yet. It started well before the attack.

The second outage started on Oct 22 and went on into early November. Between Oct 22 and Oct 30, at least 118 people tried to log in with their phone number and never got a code. The real number is higher, because our count stops at Oct 30 and the outage didn’t.

Only phone number login and sign-up were hit. People who use Google or Apple sign-in were not affected. People who were already logged in were fine too.

How the attack worked

On Oct 21, between 19:29 and 20:24 UTC, 6 Android phones opened phone login 380 times through our app. Not one of them logged in. Most of them just ran the same loop every 14 to 28 seconds: open phone login, enter a number on the Auth0 page, close the page, repeat.

Turns out this is a known scam called SMS pumping.

  • Every time we send a login code, we pay AWS for the text, and part of that money goes to the phone company that delivers it.
  • The scammers get hold of a batch of phone numbers through a phone company that’s in on the scam, or a middleman in that delivery chain. Then they make our app send codes to those numbers over and over.
  • The phone company gets paid for every text. They never need to log in or even read the code. They just need us to keep sending, and we pay for every text.

What gave it away:

  • All 6 phones were on Wi-Fi behind one public IP address in Dhaka, Bangladesh.
  • They all reported the same carrier, “CHINA MOBILE”, which is odd for phones in Bangladesh.
  • The timing was too regular for a person. Devices 2 and 3 never went faster than one attempt every 20 seconds.
  • There were 384 attempts from Bangladesh that day. 368 of them ended with the login page closed, and none ended in a login.

We still don’t know how many texts this actually sent. PostHog only records taps inside our app, not the SMS itself. Auth0’s free plan only keeps logs for 1 day, so the Oct 21 entries were already gone by the time we looked.

What we fixed

The main fix is a daily limit. No phone number can get more than 5 codes a day, no matter how the request comes in. The check lives in the Auth0 Action that sends the SMS.

Protection What it does
5 codes per number per day One number can’t get endless codes anymore
60-second wait between codes Tapping Resend quickly doesn’t use up the 5
Blocklist Lets us block number ranges used by bots, instantly
Spending alarm Warns us when SMS use suddenly jumps

How a code request works now

Every code request goes through these checks before an SMS is sent. If one of them stops the request, nothing gets sent and it costs us nothing.

What we learned

We didn’t have any alert for misuse of our services and any limit alert. We found out because people told us their codes weren’t arriving. Nothing looked broken to our tools. Only the SMS bill went up. Implementing a fallback for our services and an SMS limit alarm could have prevented the service disruption.