v0.4.0.

Post-quantum exports and audit logs that don't name the people in them.

Released 6 December 2026. All releases

Highlights

  • Post-quantum exports

    An export of your users is encrypted only to hybrid ML-KEM-768 + X25519 keys or a passphrase, so password hashes and second-factor secrets in it stay safe even from a future quantum computer. Read the docs: Post-quantum exports

  • Audit logs that don't name people

    Addresses and federated identities in the audit log are HMAC pseudonyms under a secret audit key, so a copy of the log can't be matched against a list of addresses or GitHub user IDs. Read the docs: Audit logs that don't name people

All changes

Changed

Show 2 changed entriesHide changed
  • **password.New requires an audit key.** Create the service with auth.WithAuditKey(key), where key is at least 32 random bytes kept for the life of the audit log. auth.EmailLabel is replaced by Service.EmailLabel, and Service.Pseudonym and Service.HasAuditKey are added. A service without an audit key labels every address email.
  • The server generates an audit key on its first start, sealed under the master key as key kind audit. It doesn't rotate, because a new key gives every address a new label. A server that imports an export generates its own key, so labels from before and after the import differ.

Security

Show 7 security fixesHide security
  • Address labels in the audit log no longer reveal the address to anyone with a list of candidates. A label was the first 8 bytes of a plain SHA-256 of the normalized address, so anyone with a copy of the audit log could hash candidate addresses and confirm who appears in it. Labels are now an HMAC-SHA256 under a secret audit key, truncated to 128 bits, and per-address rate-limit keys, which a backend such as Redis stores, use the same key. Events recorded before the change keep their old labels, and the hash chain stays valid.
  • Federated identity labels in the audit log no longer name the person to anyone with the log. federation labelled an identity federated:<provider>: and the first 8 bytes of a plain SHA-256 of the issuer and subject. A GitHub subject is the public numeric user ID, so anyone with a copy of the audit log could hash every ID up to about 250 million and name each GitHub sign-in. With an audit key from auth.WithAuditKey, the label is federated:<provider>: and a 128-bit Service.Pseudonym of the issuer and subject; without one, it is federated:<provider>, which names no identity, as email names no address. Identities are still looked up by issuer and subject, so linked identities keep working. Events recorded before the change keep their old labels, the hash chain stays valid, and link and unlink events from before and after the change carry different labels for the same identity.
  • **auth.New refuses an audit key whose bytes all have the same value.** It checked only the length, so an all-zero key from make([]byte, auth.MinAuditKeySize), which every test in the repository used, passed, and an application that copied that code got a key anyone could guess, which turns every label back into an unkeyed hash. auth.New refuses such a key with ErrInvalidInput, and the tests use random keys.
  • Exports are encrypted only to post-quantum keys. An export holds password hashes, TOTP secrets, and recovery codes that must stay confidential for years, and a classic X25519 age key could be broken later by a quantum computer, exposing files recorded today. authexport.Export refuses, with ErrClassicRecipient, any recipient that age doesn't label post-quantum: a classic X25519, SSH, or plugin key, or a type that wraps another recipient, and tensile-auth-server export accepts only hybrid ML-KEM-768 + X25519 recipients (age1pq1…, from age-keygen 1.4 or later) or a passphrase. Importing a file encrypted to a classic key still works. The filippo.io/age dependency moves to v1.4.0.
  • A return path with dot segments can't send a person to another site after sign-in. authhttp.SafeReturnTo and the elements' safeReturnTo refused a path that starts with //, but not one that starts with // only after a browser removes its . and .. segments, for example /.//evil.example, /x/..//evil.example, or /%2e//evil.example. Both refuse any . or .. segment, plain or percent-encoded. The Next.js example's nextPath returned such a resolved path, //evil.example, and sent the person there after sign-in or step-up; it refuses it and returns an absolute URL on the app's origin. The nextPath and step-up snippets in the Node.js guide refuse a backslash, a control character, and a path that resolves to //.
  • **The SDK's rebuildRequest keeps the request on the app's own origin.** A forwarded path such as /\evil.example or one with a tab or newline resolved to another host, because URL parsing reads a backslash as a slash and drops control characters. Such a path now resolves to /.
  • **mcpauth refuses a request in which any message has a params.name that isn't a string.** The fuzzer found a body that this parser accepted and another JSON decoder refused, so the two could read the request differently.

CHANGELOG.md in the library repository is the source.