Bug 1072180 (CVE-2014-0016)

Summary: CVE-2014-0016 stunnel: Improper initialization of PRNG after fork()
Product: [Other] Security Response Reporter: Huzaifa S. Sidhpurwala <huzaifas>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: avagarwa, carnil, eparis, jkurik, pfrields, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-06 04:55:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1052780    
Attachments:
Description Flags
proposed patch none

Description Huzaifa S. Sidhpurwala 2014-03-04 05:24:51 UTC
A flaw was found in the way stunnel, a socket wrapper which can provide SSL support to ordinary applications, performed (re)initialization of PRNG after fork.  When accepting a new connection, the server forks and the child process handles the request. The RAND_bytes() function of openssl doesn't reset its state after the fork, but seeds the PRNG with the output of time(NULL). The most important consequence is that servers using EC (ECDSA) or DSA certificates may under certain conditions leak their private key.

Comment 2 Huzaifa S. Sidhpurwala 2014-03-05 06:52:47 UTC
Created attachment 870826 [details]
proposed patch

Comment 3 Avesh Agarwal 2014-03-05 15:34:38 UTC
stunnel and rhel7 have the same stunnel version 4.56 so would require fixing in rhel7 atleast if stunnel in fedora is fixed. Still looking into other rhel6/5 branches.

Comment 4 Avesh Agarwal 2014-03-05 16:35:43 UTC
Was going through the code in stunnel 4.56 version and the code uses pthread model and USE_FORK is not used when pthread is detected in rhel and fedora.

Comment 5 Avesh Agarwal 2014-03-05 16:40:30 UTC
(In reply to Avesh Agarwal from comment #4)
> Was going through the code in stunnel 4.56 version and the code uses pthread
> model and USE_FORK is not used when pthread is detected in rhel and fedora.

The same seems true for stunnel versions in rhel6 and rhel5.

Comment 6 Huzaifa S. Sidhpurwala 2014-03-06 04:54:20 UTC
As mentioned in the previous comments, this flaw does not affect the version of stunnel shipped with Red Hat Enterprise Linux 5 and 6, since these versions use POSIX threads (pthreads) and no not use fork().

For the same reason this version does not affect the version of stunnel as shipped with Fedora 19 and Fedora 20.

Comment 7 Huzaifa S. Sidhpurwala 2014-03-06 04:55:06 UTC
Statement:

Not vulnerable. This issue does not affect the version of stunnel package as shipped with Red Hat Enterprise Linux 5 and 6.