Remove UDP crypto secrets from logs

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 14:20:42 -04:00
committed by Brandon McGinty
parent 6ab37b18d8
commit 12dfa562d2
3 changed files with 4 additions and 13 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ vendored Mumble C++ source were not treated as files to modify.
Priority 0: security and crashers Priority 0: security and crashers
--------------------------------- ---------------------------------
1. UDP crypto secrets are logged [x] 1. UDP crypto secrets are logged
Files: gumble/gumble/udp15.go, gumble/gumble/crypt.go Files: gumble/gumble/udp15.go, gumble/gumble/crypt.go
Both crypto setup paths log the AES key and IV/nonce material at debug Both crypto setup paths log the AES key and IV/nonce material at debug
level. Anyone who obtains debug logs and a packet capture can decrypt level. Anyone who obtains debug logs and a packet capture can decrypt
+1 -6
View File
@@ -4,7 +4,6 @@ import (
"crypto/aes" "crypto/aes"
"crypto/cipher" "crypto/cipher"
"encoding/binary" "encoding/binary"
"encoding/hex"
"errors" "errors"
"sync" "sync"
@@ -254,11 +253,7 @@ func (cs *cryptState) setup(key, iv []byte) error {
cs.initialized = true cs.initialized = true
if log.Enabled(log.LevelDebug) { if log.Enabled(log.LevelDebug) {
log.Debug("cryptState setup: key=%s iv=%s encIV=%s nonce_prefix=%s", log.Debug("cryptState setup complete: key_len=%d iv_len=%d", len(key), len(iv))
hex.EncodeToString(cs.key[:]),
hex.EncodeToString(iv),
hex.EncodeToString(encIV[:]),
hex.EncodeToString(cs.nonce[:]))
} }
return nil return nil
+2 -6
View File
@@ -4,7 +4,6 @@ import (
"bytes" "bytes"
"crypto/aes" "crypto/aes"
"encoding/binary" "encoding/binary"
"encoding/hex"
"errors" "errors"
"math" "math"
"sync" "sync"
@@ -219,10 +218,7 @@ func (cs *cryptState15) setup15(key, clientNonce, serverNonce []byte) error {
cs.initialized = true cs.initialized = true
if log.Enabled(log.LevelDebug) { if log.Enabled(log.LevelDebug) {
log.Debug("cryptState15 setup: key=%s encryptIV=%s decryptIV=%s", log.Debug("cryptState15 setup complete: key_len=%d nonce_len=%d", len(key), len(clientNonce))
hex.EncodeToString(cs.key[:]),
hex.EncodeToString(cs.encryptIV[:]),
hex.EncodeToString(cs.decryptIV[:]))
} }
return nil return nil
@@ -648,7 +644,7 @@ func (c *Client) HandleUDPPacket15(packet []byte, pktNum uint64) {
} }
if !c.udpFirstRecv.Swap(true) && log.Enabled(log.LevelDebug) { if !c.udpFirstRecv.Swap(true) && log.Enabled(log.LevelDebug) {
log.Debug("UDP15 #%d: first packet received! hex=%s", pktNum, hex.EncodeToString(packet)) log.Debug("UDP15 #%d: first packet received (%d bytes)", pktNum, len(packet))
} }
c.udpMu.RLock() c.udpMu.RLock()