You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Daily user-ID salt is derived from BETTER_AUTH_SECRET, so past days stay reversible. Option for a random, discarded salt? #1380
With "salt user IDs" enabled, the daily salt is sha256(BETTER_AUTH_SECRET + utcDay) (getDailySalt in server/src/services/userId/userIdService.ts; same code in v2.9.3 and on master today). Because it is derived from a long-lived secret, anyone holding that secret can recompute the salt for any past day and test IP + user-agent candidates against stored user_id values. The full IPv4 address is hashed, so the search space is small.
Plausible's model avoids this: a random salt per day, kept only in memory or short-lived storage and deleted after rotation, so that not even the operator can link old IDs back to an IP.
Would you consider an option (env var or site setting) for a random daily salt that is never derived from a persistent secret? For example crypto.randomBytes(32) per UTC day, stored in Redis with a TTL of about 48 hours so all workers agree within a day and a restart on the same day keeps the same salt.
It would let self-hosters state that visit IDs cannot be traced back to an IP address after 24 hours, also by the operator. Related: #714.
Activity