bad_record_mac
bad_record_mac (20) is sent when a TLS record fails its MAC or AEAD authentication check. The received data was modified in transit, decryption failed, or the wrong key was used. This is always fatal and is the primary indicator of data tampering or a decryption key mismatch.
Alert Code
20
Level
Fatal
Standard
RFC 8446
Description
bad_record_mac is triggered when the message authentication check on a TLS record fails. In TLS 1.2 this means the HMAC did not verify. In TLS 1.3 (which uses AEAD exclusively) it means the AEAD tag verification failed. Causes include: network corruption that modified ciphertext, a MITM attack that tampered with data, key derivation mismatch between client and server, or a TLS record sequence number desync. After receiving bad_record_mac the connection must be terminated immediately with no retry on the same session.
Common Causes
- –Network corruption modifying TLS record ciphertext
- –AEAD authentication tag verification failed
- –Session key mismatch between client and server
- –TLS sequence number desync (implementation bug)
- –Active MITM tampering with encrypted records