Subject: OCSP stapling vulnerability in OpenSSL Origin: upstream, http://www.openssl.org/news/secadv_20110208.txt 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) Index: b/ssl/t1_lib.c =================================================================== --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -521,6 +521,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, } n2s(data, idsize); dsize -= 2 + idsize; + size -= 2 + idsize; if (dsize < 0) { *al = SSL_AD_DECODE_ERROR; @@ -559,9 +560,14 @@ int ssl_parse_clienthello_tlsext(SSL *s, } /* 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;