LiveActive security incident?Get immediate response
CVE Record

CVE-2021-4238: Insufficient randomness in github.com/Masterminds/goutils

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.

CriticalCVSS 9.1Not KEV-listedUpdated
Glexia's TakeAutomated analysiscritical

Security readout for executives and security teams

Plain-English summary

This issue affects a Go utility that generated random-looking strings with less randomness than callers expected. It matters when applications used those strings as short secrets, tokens, codes, or identifiers. The sources do not show active exploitation, but the CVSS score is critical because weakened randomness can reduce protection around sensitive access flows.

Executive priority

Treat as urgent where the library generated customer-facing secrets or access tokens. Treat as lower priority for non-security identifiers. Prioritize dependency inventory, affected-code review, and rotation decisions for systems that used short generated values in authentication or authorization workflows.

Technical view

github.com/Masterminds/goutils RandomAlphaNumeric and CryptoRandomAlphaNumeric always returned strings containing at least one digit. That biased output and reduced entropy, especially for short strings. Impact depends on whether consuming applications used these outputs for security-sensitive values. The published CVSS is 9.1, with high confidentiality and availability impact and no integrity impact.

Likely exposure

Exposure is likely limited to Go applications that import github.com/Masterminds/goutils and use RandomAlphaNumeric or CryptoRandomAlphaNumeric for security-relevant strings. Risk is highest for short generated values used as secrets, tokens, reset codes, invitation links, or access gates.

Exploitation context

The provided sources do not identify known active exploitation, and KEV is false. Practical exploitation would require a consuming application to rely on affected outputs for security decisions. The vulnerability reduces the search space; it is not, by itself, evidence that every dependent application is exploitable.

Researcher notes

The source evidence describes entropy loss from forced digit inclusion but does not provide exploit examples, affected version ranges beyond the supplied package record, or a named patched release. Base validation on dependency presence, vulnerable function use, and whether generated strings protect sensitive flows.

Mitigation direction

  • Inventory Go projects for github.com/Masterminds/goutils usage.
  • Identify uses of RandomAlphaNumeric and CryptoRandomAlphaNumeric.
  • Check vendor and Go vulnerability guidance for fixed versions.
  • Update to a release containing the upstream fix, if available.
  • Replace security-token generation with vetted cryptographic randomness.
  • Rotate exposed or security-sensitive values generated by affected code.

Validation and detection

  • Review go.mod and dependency lock data for Masterminds/goutils.
  • Search code for RandomAlphaNumeric and CryptoRandomAlphaNumeric calls.
  • Classify each call by security sensitivity and string length.
  • Confirm deployed builds no longer contain affected dependency code.
  • Verify secret or token generation uses approved randomness APIs.
Prepared
Confidence
medium
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cve · low confidence lookup

CVE-2021-4238 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Critical
CVSS
9.1 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
9.1CVSS 3.1CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H3.95.2Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

9.1Critical
CVSS 3.1 vector shape for CVE-2021-4238Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
github.com/Masterminds/goutilsgithub.com/Masterminds/goutilsgithub.com/Masterminds/goutils, 0unaffected
Weakness

CWE details

No CWE listed

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.