On 25 November, 1Password published the details of a security incident that began on 19 November. An attacker took over an employee’s corporate GitHub account, pushed malicious code to backend services and used it to download account records for a subset of users. Vault contents were never exposed. But one line in the list of affected data deserves more attention than it got: “Tokens present in certain emailed links for invitations, provisioning and account recovery.”
1Password’s design held, because those tokens only work alongside an SSO sign-in or a six-digit code emailed to the user. Most web applications have no such second step. In a typical app, the password reset link is the account. So we asked a narrower question: if someone copied your database tonight, would the reset tokens in it work? We read the current source of 12 widely used authentication libraries and frameworks to find out.
TL;DR
- 1Password’s breach exposed the tokens from invitation, provisioning and recovery emails. They were not usable alone, and 1Password still lengthened its email codes from six digits to ten characters.
- We read the reset-token code in 12 auth libraries on 27 November 2026. In five, a copy of the database alone yields working password reset access: Better Auth, Strapi, Payload, Supabase Auth and PocketBase.
- Supabase Auth does hash its tokens, but the hash is what goes in the email link, so the stored value is the credential.
- Five libraries store a one-way hash and two sign stateless tokens with a key kept outside the database. Those are safe from a database leak, though the stateless pair can be forged if the signing key leaks from CI/CD, which is exactly what 1Password’s attacker reached.
- The fix is cheap: store a SHA-256 of the token, never the token. And add “invalidate every outstanding token” to your breach runbook.
What 1Password got right
The interesting part of 1Password’s disclosure is that the tokens were built to survive leaking. An invitation or recovery token only completes the flow when combined with SSO or a code sent to the registered email address, so an attacker holding the token still needs the user’s inbox.
Six numeric digits is a million possibilities, roughly 20 bits. Ten alphanumeric characters is at least 3610, about 3.7 quadrillion, or nearly 52 bits. With rate limiting, six digits is usually fine. Once an attacker holds the other half of the pair, you stop wanting to depend on the rate limiter.
Your application probably does not have that second half. Click the link, choose a password, you are in. How the token sits in your database is the whole story.
Twelve libraries, three answers
We followed the token through each project’s default branch, from generation to database write to lookup. We attacked no deployment. The table describes default behaviour; several projects let you override it.
| Library | What is stored | A database copy gives an attacker |
|---|---|---|
| Better Auth 1.7 | The raw token, in the identifier reset-password:<token>. Hashing is opt-in. |
Working reset links for one hour |
| Strapi 5 (users-permissions) | The raw 128-character token on the user row | Working reset links, with no expiry field at all |
| Payload 3 | The raw 40-character token on the user document | Working reset links until expiry (one hour by default) |
| Supabase Auth | SHA-224 of email plus a six-digit code, which is also the value in the email link | Working reset links until expiry (24 hours by default when self-hosted) |
| PocketBase | Nothing, but the signing secrets live in the same SQLite file | The ability to mint reset tokens for any user |
| Laravel 13 | bcrypt hash | Nothing usable |
| Devise (Rails) | HMAC-SHA256 digest | Nothing usable |
| WordPress 7.1 | Timestamp plus a fast BLAKE2b hash | Nothing usable |
| Auth.js | SHA-256 of token plus secret | Nothing usable |
| Ory Kratos | HMAC of link tokens and codes | Nothing usable |
| Django | Nothing; HMAC over user state with SECRET_KEY |
Nothing, unless SECRET_KEY also leaks |
| Directus | Nothing; JWT signed with the app secret | Nothing, unless the secret also leaks |
The plaintext group
Better Auth generates a 24-character token and writes it into the verification table as reset-password:<token>. Its options type documents verification.storeIdentifier with a default of "plain"; set it to "hashed" and identifiers are stored as SHA-256. We have recommended Better Auth before, in our piece on the self-hosted auth migration. The fix is one line of config, but few teams know the default.
Strapi’s users-permissions plugin stores crypto.randomBytes(64) as hex directly on the user record, and the reset endpoint looks the user up by exact match on that column. The user schema has no expiry field for it. A token issued last spring and never used still works, and sits in every backup since.
Payload does the same with a 20-byte token, but at least pairs it with an expiry that defaults to one hour.
The hash that is the password
Supabase Auth is the subtle one, and the one worth reading twice. It does hash: the stored recovery_token is SHA-224 of the email address concatenated with the six-digit code. But the confirmation URL in the email is built from that same hash, and the GET /verify endpoint treats the token parameter as the hash and compares it with the stored value. The database column and the link are the same string. Magic-link sign-in emails reuse the same column, so an outstanding magic link in a copied table is a direct login, with no password change required.
Even if the links carried the code instead, hashing it would not help. A six-digit code hashed with a known email address has a million candidates. On a two-core server, plain Python recovered one in under a second.
The stateless group
Django, Directus and PocketBase store nothing. Each signs a token whose validity depends on the user’s current state, so a password change kills it. That is a sound design, with one condition: the signing key must not travel with the data. Django’s SECRET_KEY and Directus’s secret live in configuration. PocketBase derives its key from a per-user field and a per-collection secret, and both are stored in the database. A copy of data.db is enough to mint a reset token for anyone.
Now recall where 1Password’s attacker went after GitHub: the CI/CD system, which held “infrastructure related secrets”. For a Django or Directus app, that is where the signing key usually lives. Stateless tokens protect you from a database leak and expose you to a pipeline leak. The hashed group is protected from both, because a one-way hash of a random token cannot be reversed with any secret.
What to do this week
Hash at rest. If you control the code, the pattern takes ten lines. Send the raw token, store only its digest, and look up by digest:
import { randomBytes, createHash } from "node:crypto";
const sha256 = (s) => createHash("sha256").update(s).digest("hex");
const token = randomBytes(32).toString("base64url"); // goes in the email
await db.resetTokens.insert({
userId, tokenHash: sha256(token),
expiresAt: new Date(Date.now() + 30 * 60 * 1000),
});
// on redemption
const row = await db.resetTokens.findOne({ tokenHash: sha256(submitted) });
// then check expiresAt and delete the row before resetting
A fast hash is correct here. The token has 256 bits of entropy, so there is nothing to brute-force, and bcrypt would only slow down your lookups.
Flip the defaults you can. On Better Auth, set verification: { storeIdentifier: "hashed" }. Existing plaintext rows expire within the hour. On Payload, override the forgot-password flow to store a digest. On Strapi, which records no issue time, add one to the user model and reject tokens older than an hour. On Supabase, shorten the email OTP expiry and treat the auth schema, its replicas and its backups as credential stores.
Treat a copy of PocketBase’s data.db as a key compromise. Rotate collection token secrets after any suspected database exposure, and restrict who can copy the SQLite file, including your backup provider.
Fix the runbook. Most breach playbooks say “rotate credentials” and mean API keys. Outstanding reset, invitation and magic-link tokens are credentials too. Invalidate all of them as an early step, before you know the scope. If you sign tokens statelessly, rotating the signing key does the same job.
The broader lesson
1Password’s incident started with one employee’s GitHub account and ended with customer records leaving the building. The industry will argue about the first half for a month: commit signing, branch protection, two-person review for deploys. The second half is where your users live, and it comes down to one question: when your data leaks, and eventually some of it will, does it leak keys or does it leak hashes?
Auth defaults are chosen once and then inherited by every project that installs the package. That is why we audit them rather than assume them, and why we keep a patch clock on every identity component we run. If you want a second pair of eyes on your authentication flows, token storage or breach runbook, get in touch.
📷 Photo by Jametlene Reskp on Unsplash



