auth: log rejected bearer token attempts #522

Open
opened 2026-08-04 11:35:24 +00:00 by the.auditor · 0 comments
Owner

In internal/auth/auth.go, Middleware.Require() returns 401 for missing and invalid tokens but never logs the rejection. Failed authentication attempts are invisible in logs, hurting observability for brute-force or recon.

Context: PR #521 (internal/auth/auth.go:64).

Suggested fix: log at warn/debug level via the centralized logger (or pass a logger into the middleware), distinguishing missing vs invalid token.

In `internal/auth/auth.go`, `Middleware.Require()` returns 401 for missing and invalid tokens but never logs the rejection. Failed authentication attempts are invisible in logs, hurting observability for brute-force or recon. Context: PR #521 (`internal/auth/auth.go:64`). Suggested fix: log at warn/debug level via the centralized logger (or pass a logger into the middleware), distinguishing missing vs invalid token.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#522
No description provided.