Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes FF to produce SSL_ERROR_BAD_MAC_READ?

Tags:

ssl

firefox

We have a web application where sometimes the request are broken on irregular basis and only using the Firefox browser the error that comes up is :

SSL_ERROR_BAD_MAC_READ 
-12273 
"SSL received a record with an incorrect Message Authentication Code."  

One customer claimes that they have this error about every 3 minutes but the others doesn't have this problem, but the other customers have this problem only a few times.

Any idea how find out the source of that problem?

I browsed a little through the Firefox code and found that

if (NSS_SecureMemcmp(mac, pBuf, macLen) != 0) {
    /* MAC's didn't match... */
    SSL_DBG(("%d: SSL[%d]: mac check failed, seq=%d",
         SSL_GETPID(), ss->fd, ss->sec.rcvSequence));
    PRINT_BUF(1, (ss, "computed mac:", mac, macLen));
    PRINT_BUF(1, (ss, "received mac:", pBuf, macLen));
    PORT_SetError(SSL_ERROR_BAD_MAC_READ);
    rv = SECFailure;
    goto cleanup;
}

Obviously it is possible to see what was the received mac and what was the computed mac...anyone know where those logs are in FF or maybe I should enable some logging in FF?

Where can I find the logs for this in Firefox?

like image 703
simonC Avatar asked May 27 '11 07:05

simonC


People also ask

What does SSL_ error_ Bad_ mac_ Alert mean?

The 'ssl_error_bad_mac_alert' error typically occurs in Mozilla Firefox when affected users attempt to visit certain secured websites. In some cases, the error appears when the user attempts to send emails via the IMAP interface to Gmail. Mozilla Firefox ssl_error_bad_mac_alert Error.

What does bad record Mac alert mean?

If you receive the error message, "Security error: bad record message authentication code (MAC)," while trying to livestream, it means a secure connection could not be established. There are a few possible causes: Incorrect Date / Time: If the date and/or time on your device isn't set properly, it can cause this error.


2 Answers

We upgraded openSSL to the latest version available for our platform, and it worked. The problem is gone, so it was probably a bug in the openSSL implementation.

like image 50
simonC Avatar answered Oct 14 '22 00:10

simonC


This could be an issue with SSL implementation you are using. MAC is like hash of the ssl packet transferred. If the ssl packet is not flushed properly by the implementation (eating some byes or not flushing completely) you will see these kind of issues.

like image 22
Ramesh PVK Avatar answered Oct 14 '22 00:10

Ramesh PVK