Sanity check record length before skipping explicit IV in DTLS
authorDr. Stephen Henson <steve@openssl.org>
Thu, 10 May 2012 14:44:20 +0000 (14:44 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 10 May 2012 14:44:20 +0000 (14:44 +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 3b78496bf27a4409bffb8003c7b0e8baef1c622b..549dd041cec045686824d118c74e215ec4a207bc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,14 @@
 
  Changes between 1.0.0i and 1.0.0j [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 becbab91c219617452c9bacda251dadaf93331ee..07a5e97ce5cda574154f7a91b3906e765a1692f7 100644 (file)
@@ -260,7 +260,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