The function ASN1_TYPE_cmp will crash with an invalid read if an attempt is made to compare ASN.1 boolean types. Since ASN1_TYPE_cmp is used to check certificate signature algorithm consistency this can be used to crash any certificate verification operation and exploited in a denial of service attack. Any application which performs certificate verification is vulnerable, including OpenSSL clients and servers which enable client authentication. This issue affects OpenSSL versions: 1.0.2, 1.0.1, 1.0.0, and 0.9.8. This issue is fixed in versions: 1.0.2a, 1.0.1m, 1.0.0r, and 0.9.8zf. Acknowledgements: Red Hat would like to thank the OpenSSL project for reporting this issue. Upstream acknowledges Stephen Henson of the OpenSSL development team as the original reporter.
The affected ASN1_TYPE_cmp() function was introduced upstream in version 1.0.0 / 0.9.9 via the following commit: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=c7235be6 It was only backported to 0.9.8 branch upstream via the following commit: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=c22e2dd6 and first included in upstream version 0.9.8zd. Backport to 0.9.8 was done as a dependency of the CVE-2014-8275 (bug 1180187) fix. That issue was not fixed in Red Hat Enterprise Linux 5 or earlier, and hence the affected function does not exist in openssl packages in Red Hat Enterprise Linux 5 and earlier. It is possible that 1.0.0 and 1.0.1 versions prior to the CVE-2014-8275 fix were affected to a lesser extent, as that fix introduced call to the function in X509_verify().
The issue here is that ASN1_TYPE structure contains value that is union of various types. In case of BOOLEAN ASN1 type, value is integer (0 or 0xff). However, ASN1_TYPE_cmp() failed to handle this special case and used string comparison instead, which lead to value being interpreted as pointer, resulting in out of bounds read (often at NULL or near-NULL).
External References: https://openssl.org/news/secadv_20150319.txt https://access.redhat.com/articles/1384453
Upstream commit: https://git.openssl.org/?p=openssl.git;a=commitdiff;h=c3c7fb07dc975dc3c9de0eddb7d8fd79fc9c67c1
Created openssl tracking bugs for this issue: Affects: fedora-all [bug 1196738]
Created mingw-openssl tracking bugs for this issue: Affects: fedora-all [bug 1203855] Affects: epel-7 [bug 1203856]
openssl-1.0.1k-6.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
openssl-1.0.1k-6.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
openssl-1.0.1e-42.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
This issue has been addressed in the following products: Red Hat Enterprise Linux 6 Via RHSA-2015:0715 https://rhn.redhat.com/errata/RHSA-2015-0715.html
This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2015:0716 https://rhn.redhat.com/errata/RHSA-2015-0716.html
This issue has been addressed in the following products: Red Hat Storage 2.1 Via RHSA-2015:0752 https://rhn.redhat.com/errata/RHSA-2015-0752.html
This issue has been addressed in the following products: Via RHSA-2016:2957 https://rhn.redhat.com/errata/RHSA-2016-2957.html