CVE-2020-8631
NixOS vulnerability analysis and mitigation

Overview

CVE-2020-8631 affects cloud-init through version 19.4, where the software relies on Mersenne Twister for generating random passwords. The vulnerability was discovered in January 2020 and publicly disclosed in February 2020. The issue specifically relates to the rand_str function in cloudinit/util.py which calls the random.choice function, making it easier for attackers to predict generated passwords (Debian LTS, Launchpad Bug).

Technical details

The vulnerability stems from the use of Python's random.choice() function, which utilizes the Mersenne Twister algorithm. This algorithm is deterministic and explicitly documented as being unsuitable for cryptographic purposes. The implementation in cloud-init's util.py relied on this predictable random number generator for password generation, compromising the security of generated passwords (GitHub PR).

Impact

The use of a predictable random number generator makes it easier for attackers to predict passwords generated by the system, potentially leading to unauthorized access to cloud instances. This is particularly concerning in environments where password authentication is enabled by default or commonly used (Red Hat Advisory).

Mitigation and workarounds

The issue was fixed by replacing the Mersenne Twister-based random number generator with Python's SystemRandom, which uses the operating system's cryptographically secure random number generator. The fix was implemented in cloud-init version 20.1 (GitHub PR, Launchpad Bug).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22783HIGH8.1
  • NixOSNixOS
  • iris
NoYesJan 12, 2026
CVE-2026-0821MEDIUM6.9
  • NixOSNixOS
  • quickjs
NoNoJan 10, 2026
CVE-2025-68949MEDIUM5.3
  • NixOSNixOS
  • n8n
NoYesJan 13, 2026
CVE-2026-22784LOW2.3
  • NixOSNixOS
  • lychee
NoYesJan 12, 2026
CVE-2026-23497LOW1.3
  • NixOSNixOS
  • learning
NoYesJan 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management