Bug 825162 (CVE-2012-2417)

Summary: CVE-2012-2417 python-crypto: Insecure ElGamal key generation
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bkabrda, jlieskov, paul, s.adam, sbarcomb
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=moderate,public=20120418,reported=20120525,source=oss-security,cvss2=4.0/AV:N/AC:H/Au:N/C:P/I:P/A:N,rhel-6/python-crypto=defer,fedora-all/python-crypto=affected,epel-5/python-crypto=affected
Fixed In Version: PyCrypto 2.6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 825164, 825165    
Bug Blocks: 825178    

Description Jan Lieskovsky 2012-05-25 05:30:34 EDT
A security flaw was found in the implementation of ElGamal algorithm of python-crypto, a cryptography library for Python language, in the way how random number 'g' was generated (from the OSS post [1]):

     In the ElGamal schemes (for both encryption and signatures), g is
     supposed to be the generator of the entire Z^*_p group. However, in
     PyCrypto 2.5 and earlier, g is more simply the generator of a random
     sub-group of Z^*_p.

     The result is that the signature space (when the key is used for
     signing) or the public key space (when the key is used for encryption)
     may be greatly reduced from its expected size of log(p) bits, possibly
     down to 1 bit (the worst case if the order of g is 2).

     While it has not been confirmed, it has also been suggested that an
     attacker might be able to use this fact to determine the private key.

References:
[1] http://www.openwall.com/lists/oss-security/2012/05/25/1
[2] https://bugs.launchpad.net/pycrypto/+bug/985164
[3] https://www.dlitz.net/blog/2012/05/pycrypto-2-6-released/
[4] https://secunia.com/advisories/49263/

Upstream patch:
[5] https://github.com/Legrandin/pycrypto/commit/9f912f13df99ad3421eff360d6a62d7dbec755c2
Comment 1 Jan Lieskovsky 2012-05-25 05:32:59 EDT
This issue affects the version of the python-crypto package, as shipped
with Red Hat Enterprise Linux 6.

--

This issue affects the versions of the python-crypto package, as shipped with Fedora release of 15 and 16. Please schedule an update.

--

This issue affects the version of the python-crypto package, as shipped with Fedora EPEL 5. Please schedule an update.
Comment 2 Jan Lieskovsky 2012-05-25 05:34:14 EDT
Created python-crypto tracking bugs for this issue

Affects: fedora-all [bug 825164]
Affects: epel-5 [bug 825165]
Comment 5 Fedora Update System 2012-06-02 20:00:51 EDT
python-crypto-2.6-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 6 Fedora Update System 2012-06-03 19:28:01 EDT
python-crypto-2.3-6.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 7 Fedora Update System 2012-06-03 19:34:22 EDT
python-crypto-2.3-6.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2012-06-12 12:35:08 EDT
python-crypto-2.0.1-5.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Paul Howarth 2012-06-19 13:51:43 EDT
Updates now stable for all current Fedora and EPEL releases.
Comment 13 Stefan Cornelius 2012-11-01 11:17:45 EDT
Statement:

The Red Hat Security Response Team has rated this issue as having moderate security impact. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.