🔒 fix(security): redact JWT tokens and HMAC secrets in trace logs (auth_service.go) #88
Reference in New Issue
Block a user
Delete Branch "vibe/batch21-fix-jwt-secret-logs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Critical security fix. The 3 Trace-level log statements at auth_service.go:117/123/130 were printing JWT tokens and HMAC signing secrets in cleartext. Any environment with logging.level=trace (dev/staging) routed these into the log pipeline, where an attacker with log read access could forge JWTs. Replaced cleartext values with sha256-truncated fingerprints (16 hex chars) following the existing JWTSecretInfo.SecretSHA256 pattern. Found via Mistral review of pkg/server/middleware.go (Mistral noticed the trace logs while exploring related auth code). Mistral wrote the fix, trainer-takeover for the PR open + merge step (Q-059 max-turns hit before that step).