(FreeBSD Issues Fix) OpenSSL Uses Potentially Predictable Pseudo-Random Number Generator
SecurityTracker Alert ID: 1002115|
SecurityTracker URL: http://securitytracker.com/id/1002115
(Links to External Site)
Date: Jul 31 2001
Disclosure of authentication information|
Fix Available: Yes Vendor Confirmed: Yes |
Version(s): up to 0.9.6a|
OpenSSL announced a vulnerability in the cryptographic toolkit's pseudo-random number generator (PRNG) that could allow an attacker to predict future PRNG output.|
The pseudo-random number generator (PRNG) in SSLeay/OpenSSL reportedly contains a design error that weakens the function such that it could become predictable.
The PRNG function (source code file crypto/md_rand.c) uses a hash function to update its internal secret state and to generate output. The secret state consists of two items: 1) a chaining variable message digest 'md' that is the output of the hash function, and 2) a large buffer variable 'state' that is is accessed circularly and used for storing additional entropy.
When generating output bytes, vulnerable versions of OpenSSL set the 'md' variable to the hash of one half of its previous value (which is also the same half that was used as PRNG output, meaning that it is not a secret value) and some other data, including bytes from 'state'. In addition, the number of bytes used from 'state' depended on the number of bytes requested as PRNG output and could be as small as one, making a brute-force analysis of all possible cases feasible.
These two design flaws make it possible to reconstruct the complete internal PRNG state from the output of one large PRNG request (large enough gain knowledge on the 'md' variable) followed by enough consecutive 1-byte PRNG requests to cycle through all of 'state'.
A user could potentially determine future PRNG output, which could lead to an attack of the system using the PRNG output.|
The vendor has released a fix. See the Source Message for the vendor's advisory containing directions on how to obtain the appropriate fix.|
Vendor URL: www.openssl.org/ (Links to External Site)
This archive entry is a follow-up to the message listed below.|
Source Message Contents
Date: Mon, 30 Jul 2001 16:07:08 -0700 (PDT)|
Subject: FreeBSD Security Advisory FreeBSD-SA-01:51.openssl
-----BEGIN PGP SIGNED MESSAGE-----
FreeBSD-SA-01:51 Security Advisory
Topic: OpenSSL 0.9.6a and earlier contain flaw in PRNG
Credits: Markku-Juhani O. Saarinen <firstname.lastname@example.org>
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
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.
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.
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
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/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
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
# 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
FreeBSD 4.3-SECURITY (tag: RELENG_4_3)
FreeBSD 4.3-STABLE (tag: RELENG_4)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security-notifications" in the body of the message