-
-
Notifications
You must be signed in to change notification settings - Fork 668
Closed
Labels
Description
gcm.Open takes a nonce, but it's meant to be the value passed in at Seal time, not unique. From https://pkg.go.dev/crypto/cipher#NewGCM:
// ... The nonce must be NonceSize()
// bytes long and both it and the additional data must match the
// value passed to Seal.However with code like
gcm.Open(nil, foo[:gcm.NonceSize()], foo[gcm.NonceSize():], nil), we get a warning:
G407 (CWE-1204): Use of hardcoded IV/nonce for encryption by passing hardcoded slice/array (Confidence: HIGH, Severity: HIGH)