Submitted by: Bodo Moeller and Adam Langley (Google).
authorDr. Stephen Henson <steve@openssl.org>
Wed, 24 Mar 2010 13:16:42 +0000 (13:16 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 24 Mar 2010 13:16:42 +0000 (13:16 +0000)
Fix for "Record of death" vulnerability CVE-2010-0740.

CHANGES
ssl/s3_pkt.c

diff --git a/CHANGES b/CHANGES
index ce053771e3ae4974936a96b1370b675a79c0418a..b350da79f66bc2678bb790ed0defe12730accf8a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,7 +2,16 @@
  OpenSSL CHANGES
  _______________
 
- Changes between 0.9.8m and 0.9.8n [xx XXX xxxx]
+ Changes between 0.9.8m and 0.9.8n [24 Mar 2010]
+
+  *) When rejecting SSL/TLS records due to an incorrect version number, never
+     update s->server with a new major version number.  As of
+     - OpenSSL 0.9.8m if 'short' is a 16-bit type,
+     - OpenSSL 0.9.8f if 'short' is longer than 16 bits,
+     the previous behavior could result in a read attempt at NULL when
+     receiving specific incorrect SSL/TLS records once record payload
+     protection is active.  (CVE-2010-0740)
+     [Bodo Moeller, Adam Langley <agl@chromium.org>]
 
   *) Fix for CVE-2010-0433 where some kerberos enabled versions of OpenSSL 
      could be crashed if the relevant tables were not present (e.g. chrooted).
index a2ba5748d5eb4f6b4aca75fb115eb97c75449f50..5e3583c04d428cefeb28ba5d09261f5f0822a54d 100644 (file)
@@ -291,9 +291,9 @@ again:
                        if (version != s->version)
                                {
                                SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_WRONG_VERSION_NUMBER);
-                               /* Send back error using their
-                                * version number :-) */
-                               s->version=version;
+                                if ((s->version & 0xFF00) == (version & 0xFF00))
+                                       /* Send back error using their minor version number :-) */
+                                       s->version = (unsigned short)version;
                                al=SSL_AD_PROTOCOL_VERSION;
                                goto f_err;
                                }