AUSCERT External Security Bulletin Redistribution

            ESB-2001.328 -- FreeBSD-SA-01:51.openssl [REVISED]
         OpenSSL 0.9.6a and earlier contain flaw in PRNG [REVISED]
                               1 August 2001


        AusCERT Security Bulletin Summary

Product:                OpenSSL
Vendor:                 FreeBSD
Operating System:       FreeBSD
Impact:                 Access Confidential Data
                        Reduced Security
Access Required:        Remote

Ref:                    ESB-2001.327

- --------------------------BEGIN INCLUDED TEXT--------------------


FreeBSD-SA-01:51                                           Security Advisory
                                                                FreeBSD, Inc.

Topic:          OpenSSL 0.9.6a and earlier contain flaw in PRNG [REVISED]

Category:       core
Module:         openssl
Announced:      2001-07-30
Revised:        2001-07-31
Credits:        Markku-Juhani O. Saarinen <markku-juhani.saarinen@nokia.com>
                The OpenSSL Project <URL:http://www.openssl.org/>
Affects:        All releases of FreeBSD 4.x prior to 4.4,
                FreeBSD 4.3-STABLE prior to the correction date
Corrected:      2001-07-19 21:00:45 UTC (FreeBSD 4.3-STABLE)
                2001-07-19 21:01:08 UTC (FreeBSD 4.3-SECURITY aka RELENG_4_3)
FreeBSD only:   NO

0.   Revision History

v1.0  2001-07-30  Initial release
v1.1  2001-07-31  Corrected patch instructions

I.   Background

FreeBSD includes software from the OpenSSL Project.  The OpenSSL
Project is a collaborative effort to develop a robust,
commercial-grade, full-featured, and Open Source toolkit implementing
the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS
v1) protocols as well as a full-strength general purpose cryptography

II.  Problem Description

A flaw in the pseudo-random number generator (PRNG) of OpenSSL
versions previous to 0.9.6b allows an attacker to determine the PRNG
state and future output under certain restricted conditions, thereby
weakening the strength of the PRNG and any cryptographic protection
which is derived from it.  In effect, the flaw is that a portion of
the PRNG state is incorrectly used as the PRNG output, allowing
attackers to gain knowledge of the internal state of the PRNG by
observing the output if they can sample it in a certain way. 

An attack taking advantage of this flaw has been identified that can
recover the complete state of the PRNG from the output of one
carefully sized PRNG request followed by a few hundred consecutive
1-byte PRNG requests. 

This access pattern is not typically obtainable in real-world uses of
the PRNG in cryptographic protocols, and no exploit against a protocol
supported by OpenSSL is currently known.

III. Impact

By successfully exploiting a flaw in the PRNG, an attacker can gain
important information that may allow him to deduce nonces (leading to
the compromise of the protocol session) or encryption keys (allowing
the attacker to obtain the plaintext of the encrypted data).

Whether or not this flaw is exploitable depends upon the specifics of
the application using OpenSSL.  No vulnerable applications or
protocols are currently known. 

IV.  Workaround

None applicable.

V.   Solution

One of the following:

1) Upgrade your vulnerable FreeBSD system to 4.3-STABLE or the
4.3-SECURITY (aka RELENG_4_3) security branch after the respective
correction dates. 

2) FreeBSD 4.x systems prior to the correction date:

The following patch have been verified to apply to FreeBSD
4.2-RELEASE, 4.3-RELEASE and 4.3-STABLE dated prior to the correction
date.  These patches may or may not apply to older, unsupported
releases of FreeBSD.

Download the patch and the detached PGP signature from the following
locations, and verify the signature using your PGP utility. 


# cd /usr/src/
# patch -p < /path/to/patch
# cd /usr/src/secure/lib/libcrypto/
# make depend && make all install

One must also recompile any statically linked applications that use
OpenSSL's PRNG.  There are no such applications in the base system. 

3) FreeBSD 4.3-RELEASE systems:

An experimental upgrade package is available for users who wish to
provide testing and feedback on the binary upgrade process.  This
package may be installed on FreeBSD 4.3-RELEASE systems only, and is
intended for use on systems for which source patching is not practical
or convenient. 

If you use the upgrade package, feedback (positive or negative) to
security-officer@FreeBSD.org is requested so we can improve the
process for future advisories. 

During the installation procedure, backup copies are made of the files
which are replaced by the package.  These backup copies will be
reinstalled if the package is removed, reverting the system to a
pre-patched state. 

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:51/security-patch-openssl-01.51.tgz
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-01:51/security-patch-openssl-01.51.tgz.asc

Verify the detached PGP signature using your PGP utility.

# pkg_add security-patch-openssl-01.51.tgz

VI.   Correction details

The following list contains the revision numbers of each file that was
corrected for the maintained versions of FreeBSD. 

FreeBSD Version and CVS Tag
  Path                                                           Revision
- - -------------------------------------------------------------------------
FreeBSD 4.3-SECURITY (tag: RELENG_4_3)
FreeBSD 4.3-STABLE (tag: RELENG_4)
- - -------------------------------------------------------------------------

VII.  References

Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org


- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content.  The decision to use any or all of this information is
the responsibility of each user or organisation, and should be done so in
accordance with site policies and procedures.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the original authors to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:


If you believe that your system has been compromised, contact AusCERT or
your representative in FIRST (Forum of Incident Response and Security

Internet Email: auscert@auscert.org.au
Facsimile:	(07) 3365 7031
Telephone:	(07) 3365 4417 (International: +61 7 3365 4417)
		AusCERT personnel answer during Queensland business hours
		which are GMT+10:00 (AEST).
		On call after hours for emergencies.

Version: 2.6.3i
Charset: noconv
Comment: ftp://ftp.auscert.org.au/pub/auscert/AUSCERT_PGP.key