Bug 1202366 (CVE-2015-0286)

Summary: CVE-2015-0286 openssl: invalid pointer use in ASN1_TYPE_cmp()
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: aavati, acathrow, alonbl, bazulay, bmcclain, bugzilla-redhat, cdewolf, cfergeau, dandread, darran.lofthouse, dblechte, dknox, ecohen, erik-fedora, fnasser, huwang, idith, iheim, jason.greene, jawilson, jboss-set, jclere, jdoyle, ktietz, lfarkas, lgao, lsurette, marcandre.lureau, michal.skrivanek, myarboro, nlevinki, pgier, pslavice, rbalakri, rfortier, rhs-bugs, rh-spice-bugs, rjones, rsvoboda, security-response-team, sgirijan, smohan, ssaha, steve.rigby, tmraz, twalsh, vbellur, vtunka, weli, yeylon, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=moderate,public=20150319,reported=20150316,source=upstream,cvss2=4.3/AV:N/AC:M/Au:N/C:N/I:N/A:P,cwe=CWE-822->CWE-125,rhel-5/openssl=notaffected,rhel-5/openssl097a=notaffected,rhel-6/openssl=affected,rhel-6/openssl098e=notaffected,rhel-7/openssl=affected,rhel-7/openssl098e=notaffected,fedora-all/openssl=affected,fedora-all/mingw-openssl=affected,epel-7/mingw-openssl=affected,eap-5/openssl=notaffected,eap-6/openssl=notaffected,jbews-1/openssl=wontfix,jbews-2/openssl=notaffected,jbews-3/openssl=affected,rhes-2.1/openssl=affected,rhev-m-3/mingw-virt-viewer=affected
Fixed In Version: openssl 1.0.2a, openssl 1.0.1m, openssl 1.0.0r, openssl 0.9.8zf Doc Type: Bug Fix
Doc Text:
An invalid pointer use flaw was found in OpenSSL's ASN1_TYPE_cmp() function. A remote attacker could crash a TLS/SSL client or server using OpenSSL via a specially crafted X.509 certificate when the attacker-supplied certificate was verified by the application.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-13 12:30:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 1242355, 1196738, 1203070, 1203071, 1203082, 1203083, 1203855, 1203856, 1205026, 1205494, 1205495, 1207507, 1242354, 1242909, 1242910    
Bug Blocks: 1202442, 1205499, 1395463    

Description Martin Prpič 2015-03-16 13:34:59 UTC
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.

Comment 1 Tomas Hoger 2015-03-17 21:07:31 UTC
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().

Comment 5 Tomas Hoger 2015-03-18 09:57:54 UTC
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).

Comment 8 Tomas Hoger 2015-03-19 19:02:39 UTC
Created openssl tracking bugs for this issue:

Affects: fedora-all [bug 1196738]

Comment 9 Tomas Hoger 2015-03-19 19:02:42 UTC
Created mingw-openssl tracking bugs for this issue:

Affects: fedora-all [bug 1203855]
Affects: epel-7 [bug 1203856]

Comment 10 Fedora Update System 2015-03-22 04:39:54 UTC
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.

Comment 11 Fedora Update System 2015-03-22 04:40:35 UTC
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.

Comment 12 Fedora Update System 2015-03-23 07:17:51 UTC
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.

Comment 13 errata-xmlrpc 2015-03-23 20:51:33 UTC
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

Comment 14 errata-xmlrpc 2015-03-23 23:04:41 UTC
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

Comment 17 errata-xmlrpc 2015-03-30 07:58:38 UTC
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

Comment 22 errata-xmlrpc 2016-12-15 22:14:01 UTC
This issue has been addressed in the following products:



Via RHSA-2016:2957 https://rhn.redhat.com/errata/RHSA-2016-2957.html