Repository navigation
Upgrade umami-extra-privacy to v1.0.0 - #50
Merged
Merged
Conversation
v1.0.0 replaces the salted daily hash behind `geo-hash` with a random key that lives only in the server process's memory and is wiped at each UTC midnight (and on restart). A stand-in can no longer be traced back to a real address after its day ends, even by someone holding our env files and the Umami database. The `salt` option and IP_HASH_SALT are gone, and the IPv6 stand-in now keeps 28 bits instead of 48 and zeroes the interface ID. It also stops forwarding addresses it cannot parse. v0.1.0 passed `::ffff:1.2.3.4`, `1.2.3.4:443` and junk to Umami unchanged under `geo-hash`. Our server listens on IPv4 and hands the route a plain address from X-Forwarded-For, so this was latent here, but the new test pins it. The dependency now points at the `v1.0.0` tag instead of a commit SHA. Dependabot only follows git refs that look like versions; a SHA ref is never updated, which is how this release went unnoticed. yarn.lock still pins the resolved commit (cdc7422), and a yarn install keeps that commit even if the tag is later moved, so the lockfile remains the real pin. The client helper is unchanged, so lib/analytics needs no change, and `yarn build` produces a byte-identical dist/. Only dist-server changes. - server/routes/counter.ts: describe the new scheme, drop stale salt and Next.js notes. - server/routes/counter.test.ts: drive the real route with fetch stubbed and pin what reaches Umami: the /19 kept and the rest shuffled, the same stand-in all day and new ones the next, mapped IPv6 handled as IPv4, IPv6 cut to 28 bits, unparseable addresses left out, no salt needed. - .env.local.example: remove IP_HASH_SALT.
umami-extra-privacy v1.0.0 no longer uses a daily salt. The stand-in address is made with a random key that is never saved and is erased every day, after which nobody can map it back to a real address. The "How we anonymize your IP" section said the salt rotated daily; it now describes the key, in fewer words. This changes dist/, so it needs a new WEBCAT signature.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades
@activistchecklist/umami-extra-privacyto v1.0.0 and updates the Privacy page to match.POST /api/counter toWebRequest: x-forwarded-for = trusted client IP createRouteHandler({ level: "geo-hash" }) anonymizeIp(ip) - sha256(ip + day + IP_HASH_SALT) # anyone with the salt can redo any past day + keyed shuffle, random key # memory only, wiped at UTC midnight and on restart sendUmamiEvent(payload)What Umami receives:
::ffff:1.2.3.4,1.2.3.4:443, junkIP_HASH_SALTThe pin is now
#v1.0.0instead of a SHA. Dependabot only updates git refs that look like version tags (latest_git_version_detailsin dependabot-core); a SHA ref is never updated, which is how this release went unnoticed.yarn.lockstill pins commitcdc7422. A local test showed yarn 1 keeps the locked commit after a tag is moved, with or without--frozen-lockfile.lib/analytics/events.tsneeds no change: the package's/clientAPI is identical in v1.0.0.Evidence
Before (v0.1.0,
geo-hash):After:
server/routes/counter.test.ts, through the real route:Full suite: 86 files, 852 tests pass. Lint, typecheck and build are clean.
Live relay against a local stand-in for Umami on 127.0.0.1 (run before rebasing onto Raise the Node floor to 24.22.3 and clear the minimatch alert #49):
Both pages loaded only from their own origin.
Merge Danger
Door: two-way, while
IP_HASH_SALTstays in the production envv0.1.0 throws without the salt, so a revert after the variable is deleted would break the relay until it is restored. Delete it once this has been live for a while.
Blast Radius: analytics
Each deploy or restart starts a new key, so a visitor active across one counts as two sessions that day. The upgrade alone builds a byte-identical
dist/(checked before rebasing); the Privacy page copy changes it, so pushing main needs a WEBCAT signature.