RandomAlphaNumeric and CryptoRandomAlphaNumeric are not as random as they should beGHSA-xg2h-wx96-xgxr
Fix: Masterminds/goutils@869801fGHSA-xg2h-wx96-xgxr is a CWE-331 vulnerability in github.com/Masterminds/goutils. 1 public exploit reference exists, so weaponization risk is real. A fix is available for github.com/Masterminds/goutils — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-xg2h-wx96-xgxr.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
github.com/Masterminds/goutilsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
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.)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/Masterminds/goutils | all versions | 1.1.1go get github.com/Masterminds/goutils@v1.1.1 |
Affected Products
goutilsgoutils_projectResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/Masterminds/goutils, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/Masterminds/goutils to 1.1.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-xg2h-wx96-xgxr is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| OpenShift Service Mesh 2.1 | servicemesh-0:2.1.6-1.el8 | RHSA-2023:0540 |
| Red Hat OpenShift Container Platform 4.10 | openshift4/ose-cluster-network-operator:v4.10.0-202301310115.p0.gdc0a59a.assembly.stream | RHSA-2023:0561 |
| Red Hat OpenShift Container Platform 4.10 | openshift4/ose-installer:v4.10.0-202302161028.p0.g8862860.assembly.stream | RHSA-2023:0899 |
| Red Hat OpenShift Container Platform 4.10 | openshift4/ose-machine-config-operator:v4.10.0-202303032215.p0.ga21b2b8.assembly.stream | RHSA-2023:1154 |
| Red Hat OpenShift Container Platform 4.10 | openshift4/ose-kubernetes-nmstate-handler-rhel8:v4.10.0-202303162241.p0.g68b1665.assembly.stream | RHSA-2023:1393 |
| Red Hat OpenShift Container Platform 4.11 | openshift4/ose-cluster-baremetal-operator-rhel8:v4.11.0-202301191245.p0.g4ffdd2f.assembly.stream | RHSA-2023:0565 |
| Red Hat OpenShift Container Platform 4.11 | openshift4/ose-machine-config-operator:v4.11.0-202302071115.p0.gc101063.assembly.stream | RHSA-2023:0651 |
| Red Hat OpenShift Container Platform 4.11 | openshift4/ose-installer:v4.11.0-202302130454.p0.g59d1196.assembly.stream | RHSA-2023:0774 |
Frequently Asked Questions
Is GHSA-xg2h-wx96-xgxr in your dependencies?
Find it across Go, including transitive dependencies.