Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS03OTQzLTgyamctd213Nc4AAtUJ

Argo CD certificate verification is skipped for connections to OIDC providers

Impact

All versions of Argo CD starting with v0.4.0 are vulnerable to an improper certificate validation bug which could cause Argo CD to trust a malicious (or otherwise untrustworthy) OIDC provider.

(Note: external OIDC provider support was added in v0.11.0. Before that version, the notes below apply only to the bundled Dex instance.)

You are impacted if 1) have SSO enabled and 2) insecure mode is not enabled on the API server. In this case, certificate verification is skipped when connecting to your OIDC provider for the following tasks: verifying auth tokens on API requests and handling SSO login flows. If you are using the bundled Dex instance but have not set the --dex-server flag on the API server to an HTTPS address, then certificate verification is not being skipped (because TLS is not enabled by default for the bundled Dex instance).

Argo CD sends requests to the configured OIDC provider (either the bundled Dex instance or an external provider) to 1) retrieve the OpenID configuration, 2) to retrieve the OIDC provider's key set (at the location determined by the OIDC provider's configured jwks_uri), and 3) (during an SSO login) to exchange an authorization code for a token.

(Note: Starting with v2.3.0, certificate verification is not skipped when handling an SSO login flow if 1) you are not using the bundled Dex OIDC provider and 2) you have set oidc.config.rootCA in the argocd-cm ConfigMap. Certificate verification is still skipped when verifying tokens on API calls.)

Skipping certificate verification when communicating with the OIDC provider opens Argo CD to a variety of risks. For example, if an attacker can successfully intercept, decrypt, and respond to requests bound for the configured OIDC provider (a machine-in-the-middle attack), they could theoretically issue a "valid" admin token. Verifying the OIDC provider's certificate provides an extra layer of protection against such an attack.

Patches

A patch for this vulnerability has been released in the following Argo CD versions:

Note:

To preserve backwards compatibility, this patch adds a oidc.tls.insecure.skip.verify option to the argocd-cm ConfigMap. The default is "false". Before resorting to setting this, you should try to get certificate verification to work. If you are using the bundled Dex instance, user your Argo CD API server's TLS configuration since the API server acts as a reverse proxy to Dex. If you are using an external OIDC provider, set the rootCA config.

If these fail, be sure you are aware of the risks before setting oidc.tls.insecure.skip.verify: "true".

Workarounds

There is no complete workaround besides upgrading.

Partial mitigation when using an external OIDC provider

If you are using an external OIDC provider (not the bundled Dex instance), then you can mitigate the issue by setting the oidc.config.rootCA field in the argocd-cm ConfigMap. If your OIDC provider's certificate is self-signed or otherwise invalid, you must set the rootCA to a certificate that enables verification. If the OIDC provider's certificate passes without an additional root CA, then you can set oidc.config.rootCA to a bogus non-empty string such as "force cert verification". The API server will log a warning, but otherwise things should work fine.

Example:

metadata:
  name: argocd-cm
data:
  oidc.config: |
    ...
    rootCA: |
      force cert verification

This mitigation only forces certificate validation when the API server handles login flows. It does not force certificate verification when verifying tokens on API calls. To fully resolve the vulnerability, you must upgrade.

References

Credits

@jannfis and @crenshaw-dev 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

Permalink: https://github.com/advisories/GHSA-7943-82jg-wmw5
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS03OTQzLTgyamctd213Nc4AAtUJ
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: over 2 years ago
Updated: almost 2 years ago


CVSS Score: 8.4
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H

Identifiers: GHSA-7943-82jg-wmw5, CVE-2022-31105
References: Repository: https://github.com/argoproj/argo-cd
Blast Radius: 12.5

Affected Packages

go:github.com/argoproj/argo-cd
Dependent packages: 88
Dependent repositories: 31
Downloads:
Affected Version Ranges: >= 2.4.0, < 2.4.5, >= 2.3.0, < 2.3.6, >= 0.4.0, < 2.2.11
Fixed in: 2.4.5, 2.3.6, 2.2.11
All affected versions: 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.4.6, 0.4.7, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.9.1, 0.9.2, 0.10.0, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.5, 0.10.6, 0.11.0, 0.11.1, 0.11.2, 0.12.0, 0.12.1, 0.12.2, 0.12.3, 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.7.12, 1.7.13, 1.7.14, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7
All unaffected versions: 0.1.0, 0.2.0, 0.3.0, 0.3.1, 0.3.2, 0.3.3