Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹 Go
Not in CISA KEV

RandomAlphaNumeric and CryptoRandomAlphaNumeric are not as random as they should beGHSA-xg2h-wx96-xgxr

Fix: Masterminds/goutils@869801f

GHSA-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.

Also known asCVE-2021-4238GHSA-3839-6r69-m497GO-2022-0411
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
1 known
Exploitation data as of Oct 13, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

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

via FIRST.org ↗
1.4%probability of exploitation in next 30 days
Lower Risk+0.04%
Lower risk than most CVEs71th percentile — riskier than 71% of all scored CVEsHighest risk
0.00%0.62%1.24%1.86%0.3%1.4%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

Real-World Exposure

1 pkg affected
🐹github.com/Masterminds/goutils

Real-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

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gogithub.com/Masterminds/goutilsall versions1.1.1go get github.com/Masterminds/goutils@v1.1.1

Affected Products

1 product · 1 configurations
Application
goutilsgoutils_project
< 1.1.1
range
Exploits & PoCs
1

Research 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 dependency
  1. Detect

    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.

  2. 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.

  3. 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.

Red HatImportant
ProductFixed inAdvisory
OpenShift Service Mesh 2.1servicemesh-0:2.1.6-1.el8RHSA-2023:0540
Red Hat OpenShift Container Platform 4.10openshift4/ose-cluster-network-operator:v4.10.0-202301310115.p0.gdc0a59a.assembly.streamRHSA-2023:0561
Red Hat OpenShift Container Platform 4.10openshift4/ose-installer:v4.10.0-202302161028.p0.g8862860.assembly.streamRHSA-2023:0899
Red Hat OpenShift Container Platform 4.10openshift4/ose-machine-config-operator:v4.10.0-202303032215.p0.ga21b2b8.assembly.streamRHSA-2023:1154
Red Hat OpenShift Container Platform 4.10openshift4/ose-kubernetes-nmstate-handler-rhel8:v4.10.0-202303162241.p0.g68b1665.assembly.streamRHSA-2023:1393
Red Hat OpenShift Container Platform 4.11openshift4/ose-cluster-baremetal-operator-rhel8:v4.11.0-202301191245.p0.g4ffdd2f.assembly.streamRHSA-2023:0565
Red Hat OpenShift Container Platform 4.11openshift4/ose-machine-config-operator:v4.11.0-202302071115.p0.gc101063.assembly.streamRHSA-2023:0651
Red Hat OpenShift Container Platform 4.11openshift4/ose-installer:v4.11.0-202302130454.p0.g59d1196.assembly.streamRHSA-2023:0774

Frequently Asked Questions

### 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 rando
O3 Security · Impact-Aware SCA

Is GHSA-xg2h-wx96-xgxr in your dependencies?

Find it across Go, including transitive dependencies.

GHSA-xg2h-wx96-xgxr: goutils — Fixed in 1.1.1