Skip to content

We use analytics cookies to see how the site is used. They are only set if you accept. Accepting also turns on session recording (pages viewed, clicks and scrolls) so we can fix problems; what you type stays hidden. It also lets Meta (Facebook) see your visit, so we can measure our ads. Read the privacy policy

A seismograph trace on graph paper, flat until a tall spike of signups, under the headline Free tier, flooded.

Incident report · hypothetical · 9 min read

Free Tier Abuse: A Hypothetical Postmortem of One Weekend of Fake Signups, and the Quotas That Would Have Held

A made-up but realistic incident report: a small API loses its free tier to scripted signups over one weekend. The timeline, the five faults behind it, and the limits, keys and checks that close each one.

signup free quota OCR queue paid jobs hosting bill
Epicentre: POST /signupFelt last: the bill

Nothing in this report happened to a real company: the app, the people and every number in the timeline are invented, so the failure can be shown whole without pointing at anyone. The standards and docs it leans on are real and linked.

The app in this story is a small text-extraction API run by one developer. Its free tier gives every account 500 page conversions a month, with no card. Paid plans start at a few dollars. It is the kind of offer a lot of indie tools make, and it is exactly what OWASP calls OAT-019, Account Creation: "Create multiple accounts for subsequent misuse."

Timeline of the weekend

All times are the app's server time. Read it as a seismograph roll: quiet, a tremor, then the main shock.

  1. Fri 23:40

    Signups per hour sit at their usual 3 to 6. Nothing alerts, because nothing is set to alert on signups at all.

  2. Sat 02:10

    Signups jump to 140 in an hour. Every address is on one of four domains the developer has never seen. Each new account converts close to 500 pages, then goes silent.

  3. Sat 06:30

    The OCR worker queue is 9 hours deep. Paying customers' jobs wait behind free ones, because the queue is first in, first out for everybody.

  4. Sat 09:15

    The hosting bill alert fires: compute for the month has passed the whole of last month. This is the first signal a human sees.

  5. Sat 09:40

    The developer blocks the four domains. Within the hour the signups come back on plain webmail addresses, each one a dotted variant of the same few usernames.

  6. Sat 11:05

    Free signups are switched off by hand. Real visitors from a newsletter mention that morning now hit a closed door.

  7. Sun 18:00

    A per-network signup limit, a challenge on the form and a shared hourly and daily ceiling on free usage ship. Free signups open again. The queue drains by Monday morning.

Fault lines: the five causes

None of these is a bug in the usual sense. Each is a limit that was counted on the wrong thing.

M1

The quota was counted per account, and accounts were free

500 pages per account is a fine promise to a person. To a script it means 500 pages per email address, and email addresses cost nothing. A limit is only as strong as the key it is counted on.

M2

The signup endpoint had no rate limit of its own

The API routes had a request limit, the signup route did not. Account creation was the cheapest call in the app and the one that unlocked all the expensive ones.

M3

Duplicate addresses were compared as typed

Google states that dots do not matter in Gmail addresses: every dotted version of a username lands in the same inbox. A uniqueness check on the raw string treated each variant as a new person.

M4

Free and paid work shared one queue

The damage was not only the bill. Because free jobs and paid jobs waited in one line, the abuse turned into an outage for the customers who pay.

M5

The only alarm watched money

The bill alert is the last signal, not the first. Signups per hour and free-tier usage per hour would have moved seven hours earlier.

Aftershock fixes, in the order they hold

Each fix answers one fault. The order matters: the first two stop the flood, the rest keep the next one small.

  1. Rate-limit account creation by network, not by account

    Count signups per IP address and per /24 network for IPv4 (per /64 for IPv6), over roughly an hour, for example with the token bucket below. A real office behind one address signs up a handful of people, not hundreds. When the limit trips, answer with 429 Too Many Requests, which the RFC says "MAY include a Retry-After header". The same RFC notes in its security section that under attack you are not required to send a 429 at all and may just drop connections, so do not spend effort writing friendly pages for a bot.

  2. Put a challenge on the form, and check it on the server

    A bot challenge only counts if the server verifies it. Cloudflare's own Turnstile documentation puts it plainly: "The client-side widget alone does not protect your forms." Its tokens are valid for 300 seconds and are meant for single use, so verify each one at signup and reject the request when the check fails.

  3. Normalize the address before you test it for uniqueness

    Lowercase it, trim it, and for gmail.com drop the dots in the local part before you store a lookup key. Check the domain against a list of throwaway providers too: the disposable-email-domains list on GitHub is a common starting point: its README quotes PyPI's director of infrastructure saying PyPI uses it to block throwaway domains at registration.

  4. Spend the free quota from a shared pool, not only per account

    Keep the per-account allowance, then add a ceiling for all free usage together, per hour and per day. When the pool is empty, free jobs wait and paid jobs do not. One number now caps what a weekend of fake accounts can ever cost.

  5. Give free work its own queue, behind paid work

    A separate queue, or at least a priority, means abuse can slow the free tier down without touching customers who pay.

  6. Alert on the leading signals

    Signups per hour against last week's same hour, free pages per hour, and the share of new accounts on domains first seen today. Any one of these would have paged at 02:30, not 09:15.

The two pieces of code that close M2 and M3

A token bucket for the signup route, kept in memory. It works for one process; with several servers, keep the same state in a shared store such as Redis. The defaults (a burst of 5, then 5 an hour) are only an example: set yours from your own normal peak per network.

const buckets = new Map()

// capacity: burst allowed; refillPerSec: steady rate after the burst
function take(key, capacity = 5, refillPerSec = 5 / 3600) {
  const now = Date.now() / 1000
  const b = buckets.get(key) ?? { tokens: capacity, at: now }
  b.tokens = Math.min(capacity, b.tokens + (now - b.at) * refillPerSec)
  b.at = now
  const ok = b.tokens >= 1
  if (ok) b.tokens -= 1
  buckets.set(key, b)
  const retryAfter = ok ? 0 : Math.ceil((1 - b.tokens) / refillPerSec)
  return { ok, retryAfter }
}

And the lookup key for duplicate signups. Store the address the person typed for sending mail; use this key only to check for an existing account.

function signupKey(email) {
  const [local, domain] = email.trim().toLowerCase().split('@')
  const user = domain === 'gmail.com' ? local.replaceAll('.', '') : local
  return user + '@' + domain
}

signupKey('[email protected]') // '[email protected]'

What not to do next time

The worst move in the timeline is 11:05: closing free signups for everybody. It stopped the abuse by turning away the real visitors that the newsletter sent that morning. Each fix above narrows the door for scripts while leaving it open for people. Asking every free user for a card would also stop most of it, but it turns a free tier into a trial and changes what you are offering, so make that call on purpose, not in the middle of an incident.

Questions a reader might ask

Is a CAPTCHA enough on its own?

No. It raises the cost of each signup, but without a per-network limit and a shared quota, a patient attacker or a paid solving service still gets through. Treat it as one layer.

Will a /24 limit block real offices or schools?

It can, if set too low. Start with a limit well above your normal peak per network, log every hit, and raise it for networks that turn out to be real.

Should free accounts need a verified email before using the product?

For an API whose free tier costs real compute, yes: send the key only after the address is confirmed. It does not stop dotted variants or throwaway inboxes, which is why it sits next to fixes 3 and 4, not in place of them.

Sources