CVE-2021-4238
criticalpriority · track · 36EPSS 0.014 · 72 %ileDEEUUSEPSS · scored 2026-10-27
Randomly-generated alphanumeric strings contain significantly less entropy than expected. The RandomAlphaNumeric and CryptoRandomAlphaNumeric functions always return strings containing at least one digit from 0 to 9. This significantly reduces the amount of entropy in short strings generated by these functions.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · high–critical · 8.3–9.1
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (33)
Products and version ranges known to be affected.
- Red Hat Enterprise Linux Advanced Cluster Security for Kubernetes 4all versionscert_bundDEcpe:/o:redhat:enterprise_linux:advanced_cluster_security_for_kubernetes_4
- Red Hat Enterprise Linux Service Interconnect 1all versionscert_bundDEcpe:/o:redhat:enterprise_linux:service_interconnect_1
- Red Hat OpenShift Container Platform 4.12all versionscert_bundDEcpe:/a:redhat:openshift:container_platform_4.12
advisories (5)
Vendor and ecosystem advisories describing this.
- WID-SEC-W-2023-0224Red Hat OpenShift: Mehrere Schwachstellen ermöglichen Umgehen von SicherheitsvorkehrungenDeutsch2023-01-30csaf · cert_bundDE
Ein entfernter, anonymer Angreifer kann mehrere Schwachstellen in Red Hat OpenShift ausnutzen, um Sicherheitsvorkehrungen zu umgehen.
- WID-SEC-W-2023-1542Red Hat OpenShift: Mehrere SchwachstellenDeutsch2023-06-22csaf · cert_bundDE
Ein entfernter, anonymer Angreifer kann mehrere Schwachstellen in Red Hat OpenShift ausnutzen, um einen Denial of Service Zustand herbeizuführen, Informationen offenzulegen, Dateien zu manipulieren oder Sicherheitsvorkehrungen zu umgehen.
- GHSA-3839-6r69-m497Duplicate Advisory: GoUtils's randomly-generated alphanumeric strings contain significantly less entropy than expected2022-12-28ghsa · osvUS
## Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-xg2h-wx96-xgxr. This link is maintained to preserve external references. ## Original Description Randomly-generated alphanumeric strings contain significantly less entropy than expected. The `RandomAlphaNumeric` and `CryptoRandomAlphaNumeric` functions always return strings containing at least one digit from 0 to 9. This significantly reduces the amount of entropy in short strings generated by these functions.
- GHSA-xg2h-wx96-xgxrRandomAlphaNumeric and CryptoRandomAlphaNumeric are not as random as they should be2021-05-21ghsa · osvUS
### Impact A security-sensitive bug was discovered by Open Source Developer *Erik Sundell of Sundell Open Source Consulting AB*. The functions `RandomAlphaNumeric(int)` and `CryptoRandomAlphaNumeric(int)` are not as random as they should be. Small values of `int` in the functions above will return a smaller subset of results than they should. For example, `RandomAlphaNumeric(1)` will always return a digit in the 0-9 range, while `RandomAlphaNumeric(4)` will return around ~7 million of the ~13M possible permutations. This is considered a security release because programs that rely upon random generators for passwords are at an increased risk of brute force-style password guessing. There is also a higher probability of collision. The problem was the result of a mistaken regular expression that only accepted random strings if they contained a digit from `[0-9]`. That restriction has been removed. ### Patches This issue has been corrected in v1.1.1. ### Workarounds If you cannot upgrade to v1.1.1, you can work around the issue by calling `RandomAlphaNumericCustom(N, true, true)`|`CryptoRandomAlphaNumericCustom(N, true, true)` instead. (Where `N` is the desired length, and `true` is the literal boolean `true`.)
- GO-2022-0411Insufficient randomness in github.com/Masterminds/goutils2022-07-01vendor · osvUS
Randomly-generated alphanumeric strings contain significantly less entropy than expected. The RandomAlphaNumeric and CryptoRandomAlphaNumeric functions always return strings containing at least one digit from 0 to 9. This significantly reduces the amount of entropy in short strings generated by these functions.
also known as (6)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (22)
External citations — patches, advisories, analysis.
- https://access.redhat.com/security/cve/cve-2021-4238cnnvd
- https://cxsecurity.com/cveshow/CVE-2021-4238/cnnvd
- https://github.com/Masterminds/goutils/Patchcnnvd
- https://github.com/Masterminds/goutils/commit/869801f20f9f1e7ecdbdb6422049d8241270d5e1cnnvd
- https://packetstormsecurity.com/files/170808/Red-Hat-Security-Advisory-2023-0540-01.htmlcnnvd
- https://packetstormsecurity.com/files/170978/Red-Hat-Security-Advisory-2023-0574-01.htmlcnnvd
- https://pkg.go.dev/vuln/GO-2022-0411cnnvd
- https://www.auscert.org.au/bulletins/ESB-2023.0708cnnvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan