Skip to content

Log only rejected TOTP codes - #187

Closed
janpenitent wants to merge 2 commits into
v4.0from
chore/v4.0-totp-validation-logging
Closed

Log only rejected TOTP codes#187
janpenitent wants to merge 2 commits into
v4.0from
chore/v4.0-totp-validation-logging

Conversation

@janpenitent

@janpenitent janpenitent commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Logs a rejected TOTP code, both the invalid one and the already used one, with the user, the source IP, the code length, the valid window and the server clock, so support can tell a clock skew apart from a mistyped or reused code; a code that passes leaves no line, and the code itself is never logged.

A rejected TOTP code left no trace, so a clock drift between the client and
the server could not be told apart from a wrong or a replayed code. Traces the
result, the valid window and the server time; the code itself is never traced.
Logging every validation fills the log with one line per successful login,
which on a deployment with many users is noise. Only the failures stay: an
invalid code and an already used one, both at warning level, with the code
length, the valid window and the server time. A code that passes leaves no
trace, and the code itself is never logged.
@janpenitent janpenitent changed the title Log the result of every TOTP validation Log only rejected TOTP codes Aug 20, 2026
@dkmstr dkmstr closed this Aug 20, 2026
@janpenitent

Copy link
Copy Markdown
Contributor Author

4.0 is sealed after release: no unreported change goes in. Kept on the fixes/v4.0-* branch in case someone needs it, not for a release.

@janpenitent
janpenitent deleted the chore/v4.0-totp-validation-logging branch August 20, 2026 16:03
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.

2 participants