matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Encryption key derivation vulnerable to timing attacks

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug: Password comparison in encryption code may leak timing information. Allows offline timing attack on encrypted data to guess password.

To reproduce:

  1. Capture encrypted config file
  2. Script password guessing with timing measurement
  3. Timing variations reveal password characters
  4. Brute force becomes more efficient

Expected behavior:

  • Use constant-time comparison (subtle.ConstantTimeCompare)
  • Ensure Argon2 parameters prevent timing leaks
  • Add rate limiting to password attempts
  • Consider authentication tag before decryption

Additional context:

  • File: config/encryption.go
  • Use crypto/subtle for comparisons
  • Review entire auth flow for timing leaks
  • Severity: Medium - offline attack vector
  • Complexity: Medium - cryptography expertise needed
  • Related: CWE-208 timing side channel

andrinoff avatar Apr 16 '26 20:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 17 '26 05:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar May 31 '26 06:05 floatpanebot