Skip to content

fix(auth): stop logging account_id on registration - #10

Merged
kipavy merged 1 commit into
mainfrom
fix/account-id-logging
Sep 1, 2026
Merged

fix(auth): stop logging account_id on registration#10
kipavy merged 1 commit into
mainfrom
fix/account-id-logging

Conversation

@kipavy

@kipavy kipavy commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Flagged while reviewing #9 and noted there as out of scope; this is the follow-up.

src/routes/auth.rs logged account_id at INFO on both registration branches:

info!(user_id = %user_id, account_id = %body.account_id, "User registered with 14-day trial");

Despite the name it is the KDF salt passed to derive_keys, not an opaque identifier. VoltiusApp/voltius#144 states the rule for deep links — never put it in a URL, because exposing it enables offline precompute against that user's password. A log line is the same exposure with a longer tail: it lands in the container logs and in anything that ships or retains them, readable by anyone with access to either.

Removed from both branches. user_id remains on each line and identifies the registration; an operator who needs the mapping can join the two columns in the database, so nothing operational is lost.

Deliberately unchanged: /v1/auth/challenge and the login response still return account_id to the account's own client. That is the protocol — the client cannot derive its keys without the salt.

296 tests pass; cargo clippy --all-targets -- -D warnings is clean.

`account_id` is the KDF salt passed to derive_keys, not an opaque identifier.
Logging it at INFO put it in the container logs and anywhere those are shipped
or retained, where it hands a reader offline precompute against that user's
password — the one value the deep-link rules say must never be exposed.

`user_id` stays on both lines and identifies the registration; the two columns
are joinable in the database if an operator needs the mapping.

The value still appears where the protocol requires it: the challenge and login
responses return it to the account's own client, which needs the salt to derive
its keys.
@kipavy
kipavy merged commit 7df4833 into main Sep 1, 2026
2 checks passed
@kipavy
kipavy deleted the fix/account-id-logging branch September 1, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant