Bug 1798731 (CVE-2020-8631) - CVE-2020-8631 cloud-init: Use of random.choice when generating random password
Summary: CVE-2020-8631 cloud-init: Use of random.choice when generating random password
Alias: CVE-2020-8631
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1798732 1798733 1812173 1812174
Blocks: 1798734
TreeView+ depends on / blocked
Reported: 2020-02-05 21:16 UTC by Pedro Sampaio
Modified: 2020-11-04 02:40 UTC (History)
13 users (show)

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.
Clone Of:
Last Closed: 2020-09-29 21:59:41 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:3898 0 None None None 2020-09-29 19:41:23 UTC
Red Hat Product Errata RHSA-2020:4650 0 None None None 2020-11-04 02:40:40 UTC

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

Note You need to log in before you can comment on or make changes to this bug.