GHSA-2m7h-86qq-fp4v CVE-2022-31034 GO-2022-0497
Insecure entropy in Argo CD's PKCE/Oauth2/OIDC params
- Severity
- 8.3 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 0.96%
- Chance of exploitation in the next 30 days. Higher than 61.69% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Fix
- Available
- 2 packages have a fixed version
Description
Impact
All versions of Argo CD starting with v0.11.0 are vulnerable to a variety of attacks when an SSO login is initiated from the Argo CD CLI or UI. The vulnerabilities are due to the use of insufficiently random values in parameters in Oauth2/OIDC login flows. In each case, using a relatively-predictable (time-based) seed in a non-cryptographically-secure pseudo-random number generator made the parameter less random than required by the relevant spec or by general best practices. In some cases, using too short a value made the entropy even less sufficient. (The specific weak parameters are listed in the References section.)
The attacks on login flows which are meant to be mitigated by these parameters are difficult to accomplish but can have a high impact (potentially granting an attacker admin access to Argo CD). The CVSS for this Security Advisory assumes the worst-case scenario.
Patches
A patch for this vulnerability has been released in the following Argo CD versions:
- v2.4.1
- v2.3.5
- v2.2.10
- v2.1.16
Workarounds
There are no workarounds. You must upgrade to a patched version to resolve the vulnerability.
References
These are the insufficiently-random parameters:
- (since 0.11.0) The
stateparameter generated by theargocd logincommand for Oauth2 login used a non-cryptographically secure source of entropy and generated a parameter that was too short to provide the entropy required in the spec. This parameter is a "recommended" part of the Oauth2 flow and helps protect against cross-site request forgery attacks. - (since 1.7.2, when PKCE was added) The
code_verifierparameter generated by theargocd logincommand for Oauth2+PKCE login used a non-cryptographically secure source of entropy. The attacks mitigated by PKCE are complex but have been observed in the wild. - (since 0.11.0) The
stateparameter generated by the Argo CD API server during a UI-initiated Oauth2 login used a non-cryptographically secure source of entropy and generated a parameter that was too short to provide the entropy required in the spec. This parameter is a "recommended" part of the Oauth2 flow and helps protect against cross-site request forgery attacks. - (since 0.11.0) The
nonceparameter generated by the Argo CD API server during a UI-initiated Oauth2 implicit flow login used a non-cryptographically secure source of entropy and generated a parameter that was too short to provide sufficient entropy. This parameter is a required part of the OIDC implicit login flow and helps protect against replay attacks.
Credits
Originally discovered by @jgwest. @jannfis and @crenshaw-dev re-discovered the vulnerability when reviewing notes from ADA Logics' security audit of the Argo project sponsored by CNCF and facilitated by OSTIF. Thanks to Adam Korczynski and David Korczynski for their work on the audit.
For more information
- Open an issue in the Argo CD issue tracker or discussions
- Join us on Slack in channel #argo-cd
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| github.com/argoproj/argo-cd | >= 0.11.0, < 2.1.16 |
2.1.16 |
| github.com/argoproj/argo-cd | >= 0.11.0 |
No fix yet |
| github.com/argoproj/argo-cd/v2 | < 2.1.16 |
2.1.16 |
| github.com/argoproj/argo-cd/v2 | >= 2.2.0, < 2.2.10 |
2.2.10 |
| github.com/argoproj/argo-cd/v2 | >= 2.3.0, < 2.3.5 |
2.3.5 |
| github.com/argoproj/argo-cd/v2 | >= 2.4.0, < 2.4.1 |
2.4.1 |
| github.com/argoproj/argo-cd/v2 | < 2.1.16>= 2.2.0, < 2.2.10>= 2.3.0, < 2.3.5>= 2.4.0, < 2.4.1 |
2.1.162.2.102.3.52.4.1 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
github.com/argoproj/argo-cd Go → 2.1.16
- go
go get github.com/argoproj/argo-cd@v2.1.16 && go mod tidy
github.com/argoproj/argo-cd/v2 Go → 2.1.16
- go
go get github.com/argoproj/argo-cd/v2@v2.1.16 && go mod tidy
Severity breakdown
CVSS 3.1 8.3
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Weakness
CWE-330: Use of Insufficiently Random Values
The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.
How to prevent it
- Architecture and Design: Use a well-vetted algorithm that is currently considered to be strong by experts in the field, and select well-tested implementations with adequate length seeds. In general, if a pseudo-random number generator is not advertised as being cryptographically secure, then it is probably a statistical PRNG and should not be used in security-sensitive contexts. Pseudo-random number generators can produce predictable numbers if the generator is known and the seed can be guessed. A 256-bit seed is a good starting point for producing a "random enough" number.
- Implementation: Consider a PRNG that re-seeds itself as needed from high quality pseudo-random output sources, such as hardware devices.
- Architecture and Design, Requirements: Use products or modules that conform to FIPS 140-2 [REF-267] to avoid obvious entropy problems. Consult FIPS 140-2 Annex C ("Approved Random Number Generators").
CWE-331: Insufficient Entropy
The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.
How to prevent it
- Implementation: Determine the necessary entropy to adequately provide for randomness and predictability. This can be achieved by increasing the number of bits of objects such as keys and seeds.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-fmxq-cgp8-87wp Argo CD: AppProject destination-namespace and resource restrictions bypassed by PreDelete/PostDelete resource hooks | Critical | Also affects github.com/argoproj/argo-cd |
| GHSA-j6cw-g6p4-7hch Argo CD repo-server command injection via crafted SSH repository SOCKS5 proxy URL | High | Also affects github.com/argoproj/argo-cd |
| GHSA-h98r-wv3h-fr38 Argo CD: Stored XSS in application link annotations enables developer-to-admin privilege escalation | High | Also affects github.com/argoproj/argo-cd |
| GO-2026-5618 Argo CD: Kubernetes Secret Extraction via ArgoCD ServerSideDiff via sensitive annotations | Medium | Also affects github.com/argoproj/argo-cd |
| GO-2026-5099 ArgoCD ServerSideDiff is vulnerable to Kubernetes Secret Extraction | Critical | Also affects github.com/argoproj/argo-cd |
| GHSA-gpx4-37g2-c8pv Argo CD Unauthenticated Remote DoS via malformed Azure DevOps git.push webhook | High | Also affects github.com/argoproj/argo-cd |
| GHSA-wp4p-9pxh-cgx2 argo-cd vulnerable unauthenticated DoS via malformed Gogs webhook payload | High | Also affects github.com/argoproj/argo-cd |
| GHSA-f9gq-prrc-hrhc Unauthenticated argocd-server panic via a malicious Bitbucket-Server webhook payload | High | Also affects github.com/argoproj/argo-cd |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor