REDHAT-BUG-479676: High severity M2Crypto M2Crypto vulnerability
The m2crypto package (allowing to call OpenSSL functions from python scripts) incorrectly checked the result after calling various cryptographic decryption functions, allowing a malformed signature to be treated as a good signature rather than as an error. This issue affected the signature checks on DSA keys and ECDSA keys used with SSL/TLS.
There are also calls to DSAverify(), ECDSAverify(), DSAdoverify() and ECDSAdoverify() that seem to think that -1 means error, and then return the return code. But 0 is also an error case (see man DSAdoverify for example).
Relevant part of the code: (SWIG/dsa.i): 261 ret = DSAdoverify(vbuf, vlen, sig, dsa); 262 DSASIGfree(sig); 263 if (ret == -1) 264 PyErrSetString(dsaerr, ERRreasonerrorstring(ERRgeterror())); 265 return ret; SWIG/ec.i
248 ret = ECDSAdoverify(vbuf, vlen, sig, key); 249 ECDSASIGfree(sig); 250 if (ret == -1) 251 PyErrSetString(ecerr, ERRreasonerrorstring(ERRgeterror())); 252 return ret;
Occurences of other above mentioned functions: SWIG]# grep -r DSAverify | more dsa.i: if ((ret = DSAverify(0, vbuf, vlen, sbuf, slen, dsa)) == -1) ec.i: if ((ret = ECDSAverify(0, vbuf, vlen, sbuf, slen, key)) == -1)
SWIG]# grep -r ECDSAverify | more ec.i: if ((ret = ECDSAverify(0, vbuf, vlen, sbuf, slen, key)) == -1)
SWIG]# grep -r ECDSAdoverify | more ec.i: ret = ECDSAdoverify(vbuf, vlen, sig, key);
Please check also the following two issues:
The implementation of the verifyfinal() function in SWIG/evp.i calls OpenSSL's EVPVerifyFinal function (which was vulnerable to the recent OpenSSL's CVE-2008-5077 flaw) and 'only' returns its value.
M2Crypto/EVP.py seems to document that as only returning 0 for failure but it can also return -1 on failure.
All these issues are related with recent OpenSSL's CVE-2008-5077 flaw. Please see:
https://bugzilla.redhat.com/showbug.cgi?id=476671
for more information.
References: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511515
Affected Software
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-479676?
The severity of REDHAT-BUG-479676 is considered high due to its impact on cryptographic signature validation.
How do I fix REDHAT-BUG-479676?
To fix REDHAT-BUG-479676, update the m2crypto package to the latest version that addresses this vulnerability.
Which software is affected by REDHAT-BUG-479676?
REDHAT-BUG-479676 affects the m2crypto package and OpenSSL version 1.1.1.
What is the nature of the issue in REDHAT-BUG-479676?
The issue in REDHAT-BUG-479676 is a failure to properly check results from cryptographic decryption functions, leading to potentially accepting invalid signatures.
What are the risks associated with not addressing REDHAT-BUG-479676?
Failing to address REDHAT-BUG-479676 may allow attackers to spoof valid signatures, compromising the integrity of the cryptographic operations.