NetBSD Security Advisory 2009-009: OpenSSL DTLS Memory Exhaustion and DSA signature verification vulnerabilities

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: NetBSD Security Officer
Date: Tuesday, July 7, 2009 - 9:46 pm

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


		 NetBSD Security Advisory 2009-009
		 =================================

Topic:		OpenSSL DTLS Memory Exhaustion and DSA signature
		verification vulnerabilities

Version:	NetBSD-current:		affected prior to 2009-07-04
		NetBSD 5.0:		affected
		NetBSD 4.0.*:		affected
		NetBSD 4.0:		affected
		pkgsrc:			openssl package prior to 0.9.8j

Severity:	Denial of Service, DSA signature spoofing

Fixed:		NetBSD-current:		July 4, 2009
		NetBSD-5-0 branch:	July 4, 2009 (NetBSD 5.0.1 will include the fix)
		NetBSD-5 branch:	July 4, 2009 (NetBSD 5.1 will include the fix)
		NetBSD-4-0 branch:	July 4, 2009 (NetBSD 4.0.2 will include the fix)
		NetBSD-4 branch:	July 4, 2009 (NetBSD 4.1 will include the fix)
		pkgsrc 2009Q1:		openssl-0.9.8j corrects this issue

Please note that NetBSD releases prior to 4.0 are no longer supported.
It is recommended that all users upgrade to a supported release.


Abstract
========

Two range check errors in the DTLS code allow a remote attacker
to exhaust memory by executing too many out of sequence handshakes
or by sending DTLS packets with a future epoch.

A mistake in handling return codes allows a remote attacker to spoof
DSA signatures on data or certificates.

These vulnerabilities have been assigned CVE-2009-1377, CVE-2009-1378,
CVE-2009-1379, CVE-2009-1386 and CVE-2009-1387.


Technical Details
=================

The OpenSSL library does not limit the number of buffered DTLS records
tagged with a future epoch. If a large amount of such packages is
received, the DTLS records will occupy large amounts of memory, causing
exhaustion. Also, no limit is imposed on the number of out-of-sequence
handshake messages received, which can also be used to exhaust all
available memory.

A different error is caused by the functions validating DSA and ECDSA
keys. These functions do not handle the return code of
EVP_VerifyFinal() properly, causing some types of signature verification
errors to be ignored. This can be used to spoof DSA signatures on
data or certificates.


Solutions and Workarounds
=========================

No workaround to the problem is currently known. Users are advised
to either restrict access to OpenSSL services to trusted users only
or to apply the patches as described below.

The following instructions describe how to upgrade your OpenSSL
binaries by updating your source tree and rebuilding and
installing a new version of OpenSSL.

* NetBSD-current:

	Systems running NetBSD-current dated from before 2009-07-04
	should be upgraded to NetBSD-current dated 2009-07-05 or later.

	The following files/directories need to be updated from the
	netbsd-current CVS branch (aka HEAD):
		crypto/dist/openssl

	To update from CVS, re-build, and re-install OpenSSL:
		# cd src
		# cvs update -d -P crypto/dist/openssl
		# cd lib/libcrypt
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libssl
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../../usr.bin/openssl
		# make USETOOLS=no cleandir
		# make USETOOLS=no dependall install

		If you use the patented libcrypto extensions,
		you will also want to execute the following commands:

		# cd ../../lib/libcrypto_idea
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto_mdc2
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto_rc5
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install

* NetBSD 5.*:

	Systems running NetBSD 5.* sources dated from before
	2009-07-04 should be upgraded from NetBSD 5.* sources dated
	2009-07-05 or later.

	NetBSD 5.1 and 5.0.1 will include the fix.

	The following files/directories need to be updated from the
	netbsd-5 or netbsd-5-0 branches:
		crypto/dist/openssl

	To update from CVS, re-build, and re-install OpenSSL:

		# cd src
		# cvs update -r <branch_name> -d -P crypto/dist/openssl
		# cd lib/libcrypt
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libssl
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../../usr.bin/openssl
		# make USETOOLS=no cleandir
		# make USETOOLS=no dependall install

		If you use the patented libcrypto extensions,
		you will also want to execute the following commands:

		# cd ../../lib/libcrypto_idea
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto_mdc2
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto_rc5
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install

* NetBSD 4.*:

	Systems running NetBSD 4.* sources dated from before
	2009-07-04 should be upgraded from NetBSD 4.* sources dated
	2009-07-05 or later.

	NetBSD 4.1 and 4.0.2 will include the fix.

	The following files/directories need to be updated from the
	netbsd-4 or netbsd-4-0 branches:
		crypto/dist/openssl

	To update from CVS, re-build, and re-install OpenSSL:

		# cd src
		# cvs update -r <branch_name> -d -P crypto/dist/openssl
		# cd lib/libcrypt
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libssl
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../../usr.bin/openssl
		# make USETOOLS=no cleandir
		# make USETOOLS=no dependall install

		If you use the patented libcrypto extensions,
		you will also want to execute the following commands:

		# cd ../../lib/libcrypto_idea
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto_mdc2
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install
		# cd ../libcrypto_rc5
		# make USETOOLS=no cleandir
		# make USETOOLS=no includes
		# make USETOOLS=no dependall install


Thanks To
=========

Daniel Mentz and the Google Security Team for discovering the vulnerabilities
and reporting them to the vendor.


Revision History
================

	2009-07-07	Initial release


More Information
================

Advisories may be updated as new information becomes available.
The most recent version of this advisory (PGP signed) can be found at 
  http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2009-009.txt.asc

Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.org/ and http://www.NetBSD.org/Security/.

Copyright 2009, The NetBSD Foundation, Inc.  All Rights Reserved.
Redistribution permitted only in full, unmodified form.

$NetBSD: NetBSD-SA2009-009.txt,v 1.1 2009/07/07 21:57:15 tonnerre Exp $

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (NetBSD)

iQIcBAEBAgAGBQJKU8fzAAoJEAZJc6xMSnBuUZAQAKtILf4tYU6tpRvYaoWqA4+2
Co7wT+h0ihGJDgK2vRSXd+gG+rAhh3vi0b4nfuJY/zHotVC1l5Y50jLB4BSP/ZbR
STP2oBx87C1qmufqRW6fpe8rifelE9O3qmixSvogupro/zQXXaVrwnhNJPSjZ+o0
uZ1SWZr78UGBcyFgtOKhBD6p9wXpNl5R7by7V4qjxB+Q0a/tPwJ6Qb2mjWYE3Aj8
BfedB/5z2eP5rsmA89yk6m9cmm15n3OEtq/lqYDyRdnZTz8QnNvWEm/byVmjqDwu
lMVtSq4QmGkS97NVCrkkb9mAYm6rqaTaxlMVKQRoWVf1CSy3ZYTDjJNmp0kCWLct
gN9AXi+9TqL9/H1tuvqpzEHHVFJh+KSxB8bayzAz4ODPbcXeSv+mNKwQF7ryO+Kk
VenqjcD/0JSmX66hDwC4RfDTmYoqcKVOpRKhHmHLsrQ53Gv56gX+5z8r4Lcz4hH5
3a6oo6GG2jzJJaz6W9C+k1G4WQklgc4CpL3t9qJsnJ2947Dc7qELj2C20iEXSNcR
VcwlSYK4Niyf7IwNjcNZaXexzIfYDByEBLWtXCbSrBEwAI3TdSstlEafHYsBVXa3
+xWJpqjFsb+2CPlFwRDIdA2Mhp7MojHFaPvsdj4Y6EfN5KVLsLmhzMpmtP0XeCsm
Iosoo4fBPrIeYefwxcNs
=64Ku
-----END PGP SIGNATURE-----
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
NetBSD/mac68k has now switched to using ELF., Takeshi Shibagaki, (Mon Mar 25, 7:10 am)
NetBSD Security Advisory 2002-005: OpenSSH protocol versio ..., NetBSD Security Officer, (Thu Jun 27, 10:11 am)
NetBSD announces new logo, reed, (Sat Oct 30, 4:33 pm)
Announcing the NetBSD 2.0.2 update, James Chacon, (Thu Apr 14, 12:09 pm)
Re: How to help NetBSD help you., Liam J. Foy, (Mon Jun 13, 9:18 am)
NetBSD Quarterly Status Report - 2005Q2, Jan Schaumann, (Tue Jul 12, 1:28 pm)
Revised estimate for release date of NetBSD 3.0, Matthias Scheler, (Fri Oct 21, 10:30 am)
cvsweb is offline on this weekend, soda, (Fri Feb 17, 6:02 am)
(unknown), Herb Peyerl, (Wed Mar 29, 6:59 pm)
NetBSD Security Advisory 2006-009: False detection of Inte ..., NetBSD Security-Officer, (Wed Apr 12, 7:33 pm)
NetBSD Security Advisory 2006-015: FPU Information leak on ..., NetBSD Security-Officer, (Thu Jun 8, 2:41 pm)
Schedule for NetBSD 3.1, Geert Hendrickx, (Thu Aug 17, 2:30 am)
NetBSD 3.1 Release Candidate 1 available for download, Geert Hendrickx, (Mon Aug 21, 1:59 pm)
NetBSD 3.1 Release Candidate 2 available for download, Geert Hendrickx, (Mon Sep 4, 11:44 am)
NetBSD &quot;Quarterly&quot; Status Report (Q1 2007), Jan Schaumann, (Wed May 30, 8:43 pm)
NetBSD hires Andrew Doran for full-time SMP development, Hubert Feyrer, (Tue Jul 24, 5:27 pm)
Results of NetBSD's 2007 Fundraising Campaign, Hubert Feyrer, (Wed Feb 27, 6:29 pm)
Inviting students to NetBSD and Google's Summer of Code, Hubert Feyrer, (Tue Mar 18, 4:32 pm)
ftp.NetBSD.org outage, S.P.Zeidler, (Sun Jun 29, 5:23 am)
Re: ftp.NetBSD.org outage, S.P.Zeidler, (Wed Jul 2, 6:11 am)
NetBSD to participate again in Google's Summer of Code, Jan Schaumann, (Sat Mar 21, 7:27 pm)
IPv6 Prefix change for the NetBSD servers at ISC, S.P.Zeidler, (Fri Apr 17, 3:47 pm)
NetBSD Security Advisory 2009-009: OpenSSL DTLS Memory Exh ..., NetBSD Security Officer, (Tue Jul 7, 9:46 pm)
NetBSD Security Advisory 2010-002: OpenSSL TLS renegotiati ..., NetBSD Security Officer, (Wed Jan 13, 4:39 am)