gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GnuTLS 2.2.4 - Security release [GNUTLS-SA-2008-1]


From: Simon Josefsson
Subject: GnuTLS 2.2.4 - Security release [GNUTLS-SA-2008-1]
Date: Mon, 19 May 2008 14:00:43 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux)

We are pleased to announce a new stable GnuTLS release: Version 2.2.4.

This release fixes three serious bugs that can crash the GnuTLS library.
We invite more detailed analysis of the problem, following our general
security advisory approach explained on:

http://www.gnu.org/software/gnutls/security.html

Particularly, it would be useful to answer the question of whether these
bugs can be exploited remotely to execute arbitrary code.  It is
certainly possible to cause the server to crash.  We don't have
resources to investigate this problem more ourselves currently.

Please send your analysis to address@hidden and I'll update the
security advisory web page pointing to it.  Be sure to check the web
page first to get updates on what has been done so far.

Below is attached our own security advisory and patch.  The file has
been verified to apply to the latest stable release of the recent stable
branches: version 1.4.5, 1.6.3, 2.0.4, and 2.2.3.  The patch will also
work with version 1.2.11 but you will need to apply it manually.  The
patch also apply to the latest development version 2.3.9 but keep in
mind that this version is not intended for production systems.

GnuTLS is a modern C library that implement the standard network
security protocol Transport Layer Security (TLS), for use by network
applications.  GnuTLS is developed for GNU/Linux, but works on many
Unix-like systems and comes with a binary installer for Windows.

The core GnuTLS library is distribute under the terms of the GNU Lesser
General Public License version 2.1 (or later).  The "extra" GnuTLS
libraries -- which contains OpenPGP and TLS/IA support, LZO compression,
the OpenSSL compatibility library -- and the self tests and command line
tools are distributed under the GNU General Public License version 3.0
(or later).  The manual is distributed under the GNU Free Documentation
License version 1.2 (or later).

The project page of the library is available at:
  http://www.gnutls.org/
  http://www.gnu.org/software/gnutls/
  http://josefsson.org/gnutls/

What's New
==========

* Version 2.2.4 (released 2008-05-19)

** Fix three security vulnerabilities.  [GNUTLS-SA-2008-1]
Thanks to CERT-FI for finding the bugs and providing detailed reports,
which allowed the bugs to be reproduced and fixed easily.  Patches
developed by Simon Josefsson and Nikos Mavrogiannopoulos.  Any updates
with more details about these vulnerabilities will be added to
<http://www.gnu.org/software/gnutls/security.html>

*** [GNUTLS-SA-2008-1-1]
*** libgnutls: Fix crash when sending invalid server name.
The crash can be triggered remotely before authentication, which can
lead to a Daniel of Service attack to disable the server.  The bug
cause gnutls to store more session resumption data than what was
allocated for, thus overwriting unallocated memory.

*** [GNUTLS-SA-2008-1-2]
*** libgnutls: Fix crash when sending repeated client hellos.
The crash can be triggered remotely before authentication, which can
lead to a Daniel of Service attack to disable the server.  The bug
triggers a null-pointer dereference.

*** [GNUTLS-SA-2008-1-3]
*** libgnutls: Fix crash in cipher padding decoding for invalid record lengths.
The crash can be triggered remotely before authentication, which can
lead to a Daniel of Service attack to disable the server.  The bug
cause gnutls to read memory beyond the end of the received record.

** API and ABI modifications:
No changes since last version.

Getting the Software
====================

GnuTLS may be downloaded from one of the mirror sites or direct from
<ftp://ftp.gnutls.org/pub/gnutls/>.  The list of mirrors can be found at
<http://www.gnu.org/software/gnutls/download.html>.  Note, that GnuTLS
is not available at ftp.gnu.org.

Here are the BZIP2 compressed sources (4.8MB):

  ftp://ftp.gnu.org/pub/gnutls/gnutls-2.2.4.tar.bz2
  http://josefsson.org/gnutls/releases/gnutls-2.2.4.tar.bz2

Here are OpenPGP detached signatures signed using key 0xB565716F:

  ftp://ftp.gnu.org/pub/gnutls/gnutls-2.2.4.tar.bz2.sig
  http://josefsson.org/gnutls/releases/gnutls-2.2.4.tar.bz2.sig

Note, that we don't distribute gzip compressed tarballs.

In order to check that the version of GnuTLS which you are going to
install is an original and unmodified one, you should verify the OpenPGP
signature.  You can use the command

     gpg --verify gnutls-2.2.4.tar.bz2.sig

This checks whether the signature file matches the source file.  You
should see a message indicating that the signature is good and made by
that signing key.  Make sure that you have the right key, either by
checking the fingerprint of that key with other sources or by checking
that the key has been signed by a trustworthy other key.  The signing
key can be identified with the following information:

pub   1280R/B565716F 2002-05-05 [expires: 2008-06-30]
      Key fingerprint = 0424 D4EE 81A0 E3D1 19C6  F835 EDA2 1E94 B565 716F
uid                  Simon Josefsson <address@hidden>
uid                  Simon Josefsson <address@hidden>

The key is available from:
  http://josefsson.org/key.txt
  dns:b565716f.josefsson.org?TYPE=CERT

Alternatively, after successfully verifying the OpenPGP signature of
this announcement, you could verify that the files match the following
checksum values.  The values are for SHA-1 and SHA-224 respectively:

3b5d8138e3ce78b3a25f8d0491da438bb8ef6a4e  gnutls-2.2.4.tar.bz2

85b29eab286bb55d48d1454bfcf5bebba63581159c9dd0850a32a4c3  gnutls-2.2.4.tar.bz2

Documentation
=============

The manual is available online at:

  http://www.gnu.org/software/gnutls/documentation.html

In particular the following formats are available:

 HTML: http://www.gnu.org/software/gnutls/manual/html_node/index.html
 PDF: http://www.gnu.org/software/gnutls/manual/gnutls.pdf

For developers there is a GnuTLS API reference manual formatted using
the GTK-DOC tools:

  http://www.gnu.org/software/gnutls/reference/gnutls-gnutls.html

Community
=========

If you need help to use GnuTLS, or want to help others, you are invited
to join our help-gnutls mailing list, see:
<http://lists.gnu.org/mailman/listinfo/help-gnutls>.

If you wish to participate in the development of GnuTLS, you are invited
to join our gnutls-devel mailing list, see:
<http://lists.gnu.org/mailman/listinfo/gnutls-devel>.

Windows installer
=================

GnuTLS has been ported to the Windows operating system, and a binary
installer is available.  The installer contains DLLs for application
development, manuals, examples, and source code.  The installer consists
of libgpg-error 1.6, libgcrypt 1.4.1, libtasn1 1.4, and GnuTLS 2.2.4.

For more information about GnuTLS for Windows:
  http://josefsson.org/gnutls4win/

The Windows binary installer and OpenPGP signature:
  http://josefsson.org/gnutls4win/gnutls-2.2.4.exe (13MB)
  http://josefsson.org/gnutls4win/gnutls-2.2.4.exe.sig

A ZIP file with the installed tree of binaries:
  http://josefsson.org/gnutls4win/gnutls-2.2.4.zip (4.6MB)
  http://josefsson.org/gnutls4win/gnutls-2.2.4.zip.sig

The checksum values for SHA-1 and SHA-224 are:

331a70b9cb64954d3187c880c1bb6994b4511775  gnutls-2.2.4.exe
9d1a58db1683673f92d1ed1611b4dfd416b0d447a1d393993cf4b494 gnutls-2.2.4.exe

df7478d51ce338844496b2bb1a888c4931e3e88f  gnutls-2.2.4.zip
c7c4bf3ea70ab24c070ee50a4497d403a44dada2b52b80d6bb413b49  gnutls-2.2.4.zip

Internationalization
====================

GnuTLS messages have been translated into Dutch, German, Malay, Polish
and Swedish.  We welcome the addition of more translations.

Support
=======

Improving GnuTLS is costly, but you can help!  We are looking for
organizations that find GnuTLS useful and wish to contribute back.  You
can contribute by reporting bugs, improve the software, or donate money
or equipment.

Commercial support contracts for GnuTLS are available, and they help
finance continued maintenance.  Simon Josefsson Datakonsult, a Stockholm
based privately held company, is currently funding GnuTLS maintenance.
We are always looking for interesting development projects.  See
http://josefsson.org/ for more details.

The GnuTLS service directory is available at:

  http://www.gnu.org/software/gnutls/commercial.html

Happy Hacking,
Simon

Attachment: pgpbVqBdhK7Ai.pgp
Description: PGP signature

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Three security vulnerabilities in GnuTLS [GNUTLS-SA-2008-1]
- -----------------------------------------------------------

Released 2008-05-19 12:00:00 UTC.

Vulnerabilities were discovered by Ossi Herrala and Jukka Taimisto
from the CROSS project at Codenomicon Ltd., and reported directly to
the vendor through CERT-FI.  Problems reproduced and patches developed
by Simon Josefsson and Nikos Mavrogiannopoulos.

All updates with more details about these vulnerabilities will be
added to <http://www.gnu.org/software/gnutls/security.html>.

libgnutls: Fix crash when sending invalid server name
- -----------------------------------------------------
[GNUTLS-SA-2008-1-1]

The crash can be triggered remotely before authentication, which can
lead to a Daniel of Service attack to disable the server.  The bug
cause gnutls to store more session resumption data than what was
allocated for, thus overwriting unallocated memory.  The fix is to
patch ext_server_name.c as below.

libgnutls: Fix crash when sending repeated client hellos
- --------------------------------------------------------
[GNUTLS-SA-2008-1-2]

The crash can be triggered remotely before authentication, which can
lead to a Daniel of Service attack to disable the server.  The bug
triggers a null-pointer dereference.  The fix is to patch
gnutls_handshake.c as below.

libgnutls: Fix crash in cipher padding decoding for invalid record lengths
- --------------------------------------------------------------------------
[GNUTLS-SA-2008-1-3]

The crash can be triggered remotely before authentication, which can
lead to a Daniel of Service attack to disable the server.  The bug
cause gnutls to read memory beyond the end of the received record.
The fix is to patch gnutls_cipher.c as below.

How to Apply the Patch
- ----------------------

This file has been verified to apply to the latest stable release of
the recent stable branches: version 1.4.5, 1.6.3, 2.0.4, and 2.2.3.
The patch will also work with version 1.2.11 but you will need to
apply it manually.  The patch also apply to the latest development
version 2.3.9 but keep in mind that this version is not intended for
production systems.

The patch was created with 'git-diff', so you will need to use '-p 1'
when invoking patch.  The following illustrate how you apply the patch
against version 1.6.3.

address@hidden:~/src$ gpg gnutls-sa-2008-01.txt.asc 
gpg: Signature made Mon 19 May 2008 12:03:18 PM CEST using RSA key ID B565716F
gpg: Good signature from "Simon Josefsson <address@hidden>"
gpg:                 aka "Simon Josefsson <address@hidden>"
address@hidden:~/src$ tar xfj gnutls-1.6.3.tar.bz2
address@hidden:~/src$ cd gnutls-1.6.3/
address@hidden:~/src/gnutls-1.6.3$ patch -p 1 < ../gnutls-sa-2008-01.txt
patching file lib/ext_server_name.c
patching file lib/gnutls_cipher.c
Hunk #1 succeeded at 445 (offset -14 lines).
Hunk #2 succeeded at 504 (offset -14 lines).
Hunk #3 succeeded at 513 (offset -14 lines).
patching file lib/gnutls_handshake.c
Hunk #1 succeeded at 929 (offset -74 lines).
address@hidden:~/src/gnutls-1.6.3$

Then build the package as normal.

diff --git a/lib/ext_server_name.c b/lib/ext_server_name.c
index 72e42ff..a2db949 100644
- --- a/lib/ext_server_name.c
+++ b/lib/ext_server_name.c
@@ -74,10 +74,27 @@ _gnutls_server_name_recv_params (gnutls_session_t session,
          len = _gnutls_read_uint16 (p);
          p += 2;

- -       DECR_LENGTH_RET (data_size, len, 0);
- -       server_names++;
+         if (len > 0)
+           {
+             DECR_LENGTH_RET (data_size, len, 0);
+             server_names++;
+             p += len;
+           }
+         else
+           _gnutls_handshake_log
+             ("HSK[%x]: Received zero size server name (under attack?)\n",
+              session);

- -       p += len;
+       }
+
+      /* we cannot accept more server names.
+       */
+      if (server_names > MAX_SERVER_NAME_EXTENSIONS)
+       {
+         _gnutls_handshake_log
+           ("HSK[%x]: Too many server names received (under attack?)\n",
+            session);
+         server_names = MAX_SERVER_NAME_EXTENSIONS;
        }

       session->security_parameters.extensions.server_names_size =
@@ -85,10 +102,6 @@ _gnutls_server_name_recv_params (gnutls_session_t session,
       if (server_names == 0)
        return 0;               /* no names found */

- -      /* we cannot accept more server names.
- -       */
- -      if (server_names > MAX_SERVER_NAME_EXTENSIONS)
- -     server_names = MAX_SERVER_NAME_EXTENSIONS;

       p = data + 2;
       for (i = 0; i < server_names; i++)
diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c
index ad192f4..942fe9f 100644
- --- a/lib/gnutls_cipher.c
+++ b/lib/gnutls_cipher.c
@@ -459,6 +459,14 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
       return GNUTLS_E_INTERNAL_ERROR;
     }

+  if (ciphertext.size < (unsigned) blocksize + hash_size)
+    {
+      _gnutls_record_log
+       ("REC[%x]: Short record length %d < %d + %d (under attack?)\n",
+        session, ciphertext.size, blocksize, hash_size);
+      gnutls_assert ();
+      return GNUTLS_E_DECRYPTION_FAILED;
+    }

   /* actual decryption (inplace)
    */
@@ -510,9 +518,7 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,

       pad = ciphertext.data[ciphertext.size - 1] + 1;  /* pad */

- -      length = ciphertext.size - hash_size - pad;
- -
- -      if (pad > ciphertext.size - hash_size)
+      if ((int)pad > (int)ciphertext.size - hash_size)
        {
          gnutls_assert ();
          /* We do not fail here. We check below for the
@@ -521,6 +527,8 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
          pad_failed = GNUTLS_E_DECRYPTION_FAILED;
        }

+      length = ciphertext.size - hash_size - pad;
+
       /* Check the pading bytes (TLS 1.x)
        */
       if (ver >= GNUTLS_TLS1 && pad_failed == 0)
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 4ab6db6..d798180 100644
- --- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,

       *recv_type = session->internals.handshake_header_buffer.recv_type;

+      if (*recv_type != type)
+       {
+         gnutls_assert ();
+         _gnutls_handshake_log
+           ("HSK[%x]: Handshake type mismatch (under attack?)\n", session);
+         return GNUTLS_E_UNEXPECTED_HANDSHAKE_PACKET;
+       }
+
       return session->internals.handshake_header_buffer.packet_length;
     }

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iOoEAQECADQFAkgxasctFIAAAAAAFQAPcGthLWFkZHJlc3NAZ251cGcub3JnamFz
QGV4dHVuZG8uY29tAAoJEO2iHpS1ZXFv3vYFAIc6Ptw8tpSpqKFbCZPX+EwIcRJ1
njhhKXJb7TRU04a4102t+DlP2Tua3yCrd7wFx6yVc0sleXmE8DqtuWNrA1rCXH4u
INMYmfYEBxSBVYIzr1G6VxcU2c36q9kaIct831kjTTNgOQTH9xuD0kf5Rwe4abB3
io9Q1tmK7SHl4ix4Mqg37+tzy6ZCqHMKrP1ls7FyYxpdBNvbZT6THi9zZNI=
=R87n
-----END PGP SIGNATURE-----

reply via email to

[Prev in Thread] Current Thread [Next in Thread]