Bug 1798731 (CVE-2020-8631)

Summary: CVE-2020-8631 cloud-init: Use of random.choice when generating random password
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: adimania, apevec, dustymabe, eterrell, gholms, jgreguske, mhayden, rmccabe, rschiron, shardy, sisharma, s, virt-maint
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: cloud-init 20.1 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in cloud-init, where it uses the random.choice function when creating sensitive random strings used for generating a random password in new instances. Depending on the instance configuration, a remote or local attacker may abuse this vulnerability to guess the password of the victim user.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 21:59:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1798732, 1798733, 1812173, 1812174    
Bug Blocks: 1798734    

Description Pedro Sampaio 2020-02-05 21:16:04 UTC
cloud-init through 19.4 relies on Mersenne Twister for a random password, which makes it easier for attackers to predict passwords, because rand_str in cloudinit/util.py calls the random.choice function.

Upstream patch:




Comment 1 Pedro Sampaio 2020-02-05 21:16:42 UTC
Created cloud-init tracking bugs for this issue:

Affects: epel-6 [bug 1798733]
Affects: fedora-all [bug 1798732]

Comment 2 Riccardo Schirone 2020-03-10 17:06:54 UTC
As cc_set_passwords module could be used to set ssh password authentication as well, the Attack Vector is set to Network.
Confidentiality, Integrity and Availability set to High because the direct impact of the flaw is the control of the user in the instance configured by cloud-init.

Comment 4 errata-xmlrpc 2020-09-29 19:41:18 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:3898 https://access.redhat.com/errata/RHSA-2020:3898

Comment 5 Product Security DevOps Team 2020-09-29 21:59:41 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


Comment 6 errata-xmlrpc 2020-11-04 02:40:37 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2020:4650 https://access.redhat.com/errata/RHSA-2020:4650