Sanity check record length before skipping explicit IV in DTLS
authorDr. Stephen Henson <steve@openssl.org>
Thu, 10 May 2012 14:33:11 +0000 (14:33 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 10 May 2012 14:33:11 +0000 (14:33 +0000)
to fix DoS attack.

Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
fuzzing as a service testing platform.
(CVE-2012-2333)

CHANGES
ssl/d1_enc.c

diff --git a/CHANGES b/CHANGES
index e2ec1e1978c2c3906eef2600ebfa5503d5f65d29..d7d37ff7756d2c7cb4d079aa9a34e584d5f07e29 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,14 @@
 
  Changes between 0.9.8w and 0.9.8x [xx XXX xxxx]
 
+  *) Sanity check record length before skipping explicit IV in DTLS
+     to fix DoS attack.
+
+     Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
+     fuzzing as a service testing platform.
+     (CVE-2012-2333)
+     [Steve Henson]
+
   *) Initialise tkeylen properly when encrypting CMS messages.
      Thanks to Solar Designer of Openwall for reporting this issue.
      [Steve Henson]
index bb96c8a20ccf10794304bf6d8df6ac60424953e2..baa75f9186b2d03ef4aa122db63b2b432dc888d1 100644 (file)
@@ -249,7 +249,7 @@ int dtls1_enc(SSL *s, int send)
                                }
                        /* TLS 1.0 does not bound the number of padding bytes by the block size.
                         * All of them must have value 'padding_length'. */
-                       if (i > (int)rec->length)
+                       if (i + bs > (int)rec->length)
                                {
                                /* Incorrect padding. SSLerr() and ssl3_alert are done
                                 * by caller: we don't want to reveal whether this is