Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

12.4 KB
Raw Blame

status: accepted

A sign-up address is checked against ZeroBounce, not a bundled blocklist

Decision

zerobounce.maySignUp — the module's only export — asks ZeroBounce's GET /v2/validate about every address that has no account yet and arrives through a public door (the sign-up form or Sign in with Google; JWT managed-auth and SAML are platform-provisioned and skipped), and refuses the sign-up on spamtrap, abuse, do_not_mail with a sub-status of disposable, toxic, possible_trap or global_suppression, or invalid with a sub-status of no_dns_entries, does_not_accept_mail or unroutable_ip_address. The disposable-email-domains package leaves the sign-up path. The check runs only when AP_ZEROBOUNCE_API_KEY is set, and AP_ALLOW_DISPOSABLE_EMAILS is deleted — the key's presence is the switch.

Context

Cloud was taking botted sign-ups. The defence was a Set built from disposable-email-domains at module load, consulted by disposableEmail.assertMaySignUp. That list is a build artefact: it is fixed at release time, so a domain registered after the build is invisible until the next release, and an operator running an older tag never sees it at all. The purge script that cleans up the platforms those sign-ups leave behind needs an explicit --domains list precisely because "the package does not know about" the evasion domains actually in use.

Why

A blocklist that ships with the release is always behind the attacker. Throwaway domains are registered continuously and cost nothing; a list compiled weeks earlier and frozen into a tag cannot see them. A hosted service answers about the domain as it is today, which is the only version that matters.

Junk, not non-existence — and a dead domain is neither. status: invalid is split by what it describes. A mailbox that does not exist (mailbox_not_found, possible_typo, mailbox_quota_exceeded) is deliberately allowed through, even though random-address bots at real domains are exactly what it would catch. Refusing it turns the public sign-up endpoint into a mailbox-existence oracle for any address at any domain, and it refuses the ordinary member who typos their own address. Bots that get in this way still cannot verify a code, so they get an unverified identity row and nothing else, which the purge path already handles. A domain that cannot receive mail at all (no_dns_entries, does_not_accept_mail, unroutable_ip_address) is refused: the verdict says nothing about any one mailbox, and it turns away nobody who would have completed sign-up, because the code could never have arrived. It closes the dead half of a throwaway farm — domains given MX just long enough to receive a code, then left with no records — which is the state such a farm is found in once someone looks.

Role addresses are accepted. do_not_mail also covers role_based, role_based_catch_all and mx_forward. Refusing those would refuse info@, sales@ and automation@ — ordinary ways a team signs up for an automation tool. The reject set is deliberately the abuse half of do_not_mail, not the whole status.

Fail open, always. An unreachable endpoint, a timeout, an invalid key, an exhausted credit balance — every one of these lets the address through with a log line. A validation outage that blocked sign-up would be a worse outage than the abuse it prevents, and ZeroBounce answers HTTP 200 with an {"error": ...} body for the key and credit cases, so that body is checked explicitly rather than left to the status code. This mirrors the posture turnstile.ts takes in the same directory, with one difference: Turnstile refuses when siteverify answers with an error status, and there is no equivalent here, because any ZeroBounce answer we cannot read is simply no verdict.

The key is the feature flag. .claude/rules/self-hosting.md forbids anything that looks enabled but is silently broken without setup, and a paid API cannot be a default. Gating on the key means an instance with no ZeroBounce account sees no check and no error, and one with a key gets it with no second switch to discover. AP_ALLOW_DISPOSABLE_EMAILS therefore had nothing left to control and was removed rather than kept as a knob that only ever agrees with the key.

The gate is keyed on the provider by denylist, not on EMAIL. The first cut ran the check only when provider === EMAIL, on the reasoning that it was an email-deliverability check. It is not — it is a new-account abuse gate — and Sign in with Google is a public door that mints a verified identity with no email ever sent. On 2026-09-16 a farm that ZeroBounce had shut down on the email path (1,458 emalupe.com accounts, dead the day the check shipped) came back through Google: a throwaway .shop domain verified with Google via a TXT record, no MX, 36 Cloud Identity accounts, every one skipping the gate. So requiresSignUpAbuseCheck refuses to check only PLATFORM_CONTROLLED_PROVIDERS (JWT, SAML) — accounts a platform provisions for itself behind a signing key or an IdP — and any future public provider is checked by default rather than silently exempt. A refused Google sign-up throws INVALID_CREDENTIALS with no params — the same answer a failed Google token exchange already produces on that endpoint — and the redirect page shows a generic "Sign-in failed". An honest DOMAIN_NOT_ALLOWED was tried first and reverted: the mailbox-oracle argument does not apply (the member owns the Google account), but the coaching argument does — an abuser reads the response body, not the toast, and "domain not allowed" tells them precisely which DNS record to add. So the Google path mimics too, just a different legitimate failure than the email path does.

The captcha comes first. In requestCode, turnstile.assertSolved runs before the validation call, so no credit is spent on a request that has not solved a challenge. That ordering is load-bearing, not incidental: it is what makes per-address credit spend bounded by solved captchas rather than by packets.

Consequences

The sign-up path now depends on a third party, and self-hosters lose a check they had by default.

  • An instance with no key accepts throwaway addresses where it previously refused them. This is a deliberate loosening for self-hosters, and deliberately not recorded in breaking-changes.mdx: nothing errors, nothing has to be done on upgrade, and the call was that no self-hoster was leaning on the bundled list. The cost is that the loss is silent — anyone who was relying on it learns from throwaway sign-ups rather than the upgrade guide. AP_ALLOW_DISPOSABLE_EMAILS is removed on the same reasoning: an instance that still sets it boots fine and the value is ignored. Self-hosted instances are not the ones under sign-up attack, and the alternative — shipping a stale list to everyone — is what was being replaced.
  • Burning the credit balance is the bypass, so disposable domains are cached. Fail-open plus an exhaustible balance means an attacker who spends the credits makes every subsequent address pass. A refusal creates no identity, so the same address can be re-tried indefinitely; without a cache each attempt cost a credit. disposable verdicts therefore accumulate in one distributedStore key, zerobounce:disposable-domains:v1, holding an ordered array of at most 500 domains: a hit is an array membership test, and a new domain is appended with the oldest dropped once the list is full. Hammering one domain costs one credit, ever, rather than one per attempt. This bounds repeat abuse, not breadth: rotating across new domains still costs a credit each, which is the edge's job (a Cloudflare rate-limiting rule on the sign-up paths), not the app's.
  • The cache is a bounded list with no TTL, not one key per domain. One key means one read on the hot path and a size cap that is simply slice(-500), where per-domain keys would need a separate index to bound them. It is insertion-ordered, not true LRU — a hit does not promote its entry, because that would put a Redis write on every refused sign-up. The read-modify-write is not atomic, so two instances adding different domains at once can lose one; the cost is one credit later, which is the right trade for a cache. Dropping the TTL makes an entry live until 500 newer domains evict it, so correcting a wrong verdict means deleting that single key and letting the list rebuild — cheap, but someone has to know the key exists. Redis is a cache, not a record: a flush or an allkeys-lru eviction silently drops the list, which costs credits and nothing else.
  • Only a domain-shaped verdict may be cached by domain. disposable is a property of the domain; toxic, global_suppression, spamtrap and abuse describe one mailbox, so caching those by domain would refuse every account on gmail.com after a single bad one. Allow-verdicts are not cached either, since a cached "this domain is fine" would skip the address-level checks for every other mailbox on it. The dead-domain invalid verdicts are domain-shaped too and are still not cached: no_dns_entries can be a registrar hiccup or a zone mid-propagation, and a list with no TTL would refuse a legitimate domain until 500 newer entries evicted it. A dead domain also gives a bot nothing to come back for, so there is no repeat-hammer to bound — the captcha bounds the credit spend. disposable is the one verdict that is both domain-shaped and stable. Tests pin each of these.
  • One credit per address that has no account yet. requestCode skips the check entirely for an existing identity, so a repeat sign-in costs nothing. A refused address creates no identity, so a bot re-hitting the same address does spend a credit per attempt; the rate limits and the captcha in front are what bound that. Running out of credits degrades to fail-open, not to an outage.
  • Both paths refuse silently, each by mimicking its own legitimate outcome. The lib only answers the question — maySignUp returns a boolean and throws nothing — because the two call sites need different disguises. requestCode returns the same 204 as a success, creating no identity and sending no code, so the card advances to "Enter your code" and none arrives. signUp throws EMAIL_IS_NOT_VERIFIED with the address, which is exactly what a real Cloud sign-up returns (the identity is created unverified, then getOnboardingResponse throws it), so the form renders its ordinary CheckEmailNote. Both mirror the silent-return 000027 already uses for the invitation check, for the same reason: a distinguishable answer turns a public endpoint into an oracle, here for "is this address disposable". DOMAIN_NOT_ALLOWED is therefore absent from this path entirely and means only the platform domain allow-list again; the Google path disguises itself as INVALID_CREDENTIALS for the same reason. The cost is that a false positive is invisible to the member and to support: the only trace is the address refused log line, so that log is the sole way to answer "why did no code arrive".
  • A mimicked response has to match the real one down to value normalization. The first cut echoed params.email as submitted while the genuine path echoes it lowercased, having read it back from the stored identity — so a mixed-case address came back [email protected] on a refusal and [email protected] on a real sign-up, which is a perfectly good oracle. Any future mimicry needs the same toLowerCase().trim() the identity service applies. The test that pins this asserts toEqual against the whole body, not just the code, which is what caught it.
  • The reject set stays domain-flavoured, so there is no new error code. Every refused verdict is a property of the domain or a mailbox flagged for abuse — never "this honest mailbox does not exist" — so the silent mimicry above holds with nothing distinguishable to show. The mailbox-level invalid sub-statuses stay out for that reason: adding one would reopen the oracle and would need its own, honest error.
  • The offline blocklist survives only inside the purge script, which classifies existing identities in bulk and must run without spending a credit per row. disposable-email-domains stays a runtime dependency for it — the runtime image installs with bun install --production, so a devDependency would not exist where that script runs.
  • A member who already holds an accepted invitation is never refused, unchanged from the blocklist behaviour.