OpenSSL Security Advisory 20110208 - Incorrectly formatted ClientHello handshake messages could cause OpenSSL to parse past the end of the message.
3db6ab2a088940be9ca5f4911b7eb0e19ae17309a7ff07ca88cd66bf66a8ee51
OpenSSL Security Advisory [8 February 2011]
OCSP stapling vulnerability in OpenSSL
======================================
Incorrectly formatted ClientHello handshake messages could cause OpenSSL
to parse past the end of the message.
This issue applies to the following versions:
1) OpenSSL 0.9.8h through 0.9.8q
2) OpenSSL 1.0.0 through 1.0.0c
The parsing function in question is already used on arbitary data so no
additional vulnerabilities are expected to be uncovered by this.
However, an attacker may be able to cause a crash (denial of service) by
triggering invalid memory accesses.
The results of the parse are only availible to the application using
OpenSSL so do not directly cause an information leak. However, some
applications may expose the contents of parsed OCSP extensions,
specifically an OCSP nonce extension. An attacker could use this to read
the contents of memory following the ClientHello.
Users of OpenSSL should update to the OpenSSL 1.0.0d (or 0.9.8r) release,
which contains a patch to correct this issue. If upgrading is not
immediately possible, the source code patch provided in this advisory
should be applied.
Neel Mehta (Google) identified the vulnerability. Adam Langley and
Bodo Moeller (Google) prepared the fix.
Which applications are affected
-------------------------------
Applications are only affected if they act as a server and call
SSL_CTX_set_tlsext_status_cb on the server's SSL_CTX. This includes
Apache httpd >= 2.3.3, if configured with "SSLUseStapling On".
Patch
-----
--- ssl/t1_lib.c 25 Nov 2010 12:28:28 -0000 1.64.2.17
+++ ssl/t1_lib.c 8 Feb 2011 00:00:00 -0000
@@ -917,6 +917,7 @@
}
n2s(data, idsize);
dsize -= 2 + idsize;
+ size -= 2 + idsize;
if (dsize < 0)
{
*al = SSL_AD_DECODE_ERROR;
@@ -955,9 +956,14 @@
}
/* Read in request_extensions */
+ if (size < 2)
+ {
+ *al = SSL_AD_DECODE_ERROR;
+ return 0;
+ }
n2s(data,dsize);
size -= 2;
- if (dsize > size)
+ if (dsize != size)
{
*al = SSL_AD_DECODE_ERROR;
return 0;
References
----------
This vulnerability is tracked as CVE-2011-0014.
URL for this Security Advisory:
https://www.openssl.org/news/secadv_20110208.txt
OCSP stapling is defined in RFC 6066 (previously RFC 3546), section
"Certificate Status Request".