CVE-2022-29165: Github.com/argoproj/argo cd/v2 Argo CD Will Blindly Trust Vulnerability

CRITICAL
Advisory Identifier: GHSA-r642-gv9p-2wjj
CVSS 10.0
CWE-287 CWE-200 CWE-290
Published
Advisory Summary

CVE-2022-29165 is a CRITICAL (CVSS 10.0) argo cd will blindly trust vulnerability (CWE-287: Improper Authentication) affecting Github.com/argoproj/argo cd/v2 libraries in the Go ecosystem. The issue involves argo cd will blindly trust jwt claims if anonymous access is enabled. Remediation is available by upgrading affected packages to version 2.3.4, 2.2.9, 2.1.15.

CVE-2022-29165 at a Glance

CVE Identifier CVE-2022-29165
GHSA Identifier GHSA-r642-gv9p-2wjj
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-287: Improper Authentication
Affected Product Github.com/argoproj/argo cd/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-29165

To remediate this vulnerability, upgrade all affected Github.com/argoproj/argo cd/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/argoproj/argo-cd/v2 fixed: 2.3.4
Upgrade github.com/argoproj/argo-cd/v2 to 2.3.4
github.com/argoproj/argo-cd/v2 fixed: 2.2.9
Upgrade github.com/argoproj/argo-cd/v2 to 2.2.9
github.com/argoproj/argo-cd/v2 fixed: 2.1.15
Upgrade github.com/argoproj/argo-cd/v2 to 2.1.15
github.com/argoproj/argo-cd fixed: 2.1.15
Upgrade github.com/argoproj/argo-cd to 2.1.15
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/argoproj/argo-cd/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-29165, inspect your project dependencies for Github.com/argoproj/argo cd/v2:

inspect dependencies for github.com/argoproj/argo-cd/v2

Analyze the terminal output to locate any version of Github.com/argoproj/argo cd/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Github.com/argoproj/argo cd/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact A critical vulnerability has been discovered in Argo CD which would allow unauthenticated users to impersonate as any Argo CD user or role, including the `admin` user, by sending a specifically crafted JSON Web Token (JWT) along with the request. In order for this vulnerability to be exploited, [anonymous access](https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/#anonymous-access) to the Argo CD instance must have been enabled. In a default Argo CD installation, anonymous access is disabled. To find out if anonymous access is enabled in your instance, please see the *Workarounds* section of this advisory below. The vulnerability can be exploited to impersonate as any user or role, including the built-in `admin` account regardless of whether that account is enabled or disabled. Also, the attacker does not need an account on the Argo CD instance in order to exploit this. If anonymous access to the instance is enabled, an attacker can: * Escalate their privileges, effectively allowing them to gain the same privileges on the cluster as the Argo CD instance, which is cluster admin in a default installation. This will allow the attacker to create, manipulate and delete any resource on the cluster. * Exfiltrate data by deploying malicious workloads with elevated privileges, thus bypassing any redaction of sensitive data otherwise enforced by the Argo CD API We **strongly recommend** that all users of Argo CD update to a version containing this patch as soon as possible, regardless of whether or not anonymous access is enabled in your instance. Please see below for a list of versions containing a fix for this vulnerability and any possible workarounds existing for this issue. ### Patches A patch for this vulnerability has been released in the following Argo CD versions: * v2.3.4 * v2.2.9 * v2.1.15 ### Workarounds #### Disable anonymous access If you are not able to upgrade to a patched version quickly, we highly suggest disabling anonymous access if it is enabled. To find out whether anonymous access is enabled for your Argo CD instance, you can query the `argocd-cm` ConfigMap in the Argo CD's installation namespace. The below example assumes you have installed Argo CD to the `argocd` namespace: ```shell $ kubectl get -n argocd cm argocd-cm -o jsonpath='{.data.users\.anonymous\.enabled}' ``` If the result of this command is either empty or `"false"`, anonymous access to that instance is not enabled. If the result is `"true"`, your instance is vulnerable. To disable anonymous access, patch the `argocd-cm` ConfigMap to either remove the `users.anonymous.enabled` field or set this field to `"false"`. To set the field to `"false"`: ```shell $ kubectl patch -n argocd cm argocd-cm --type=json -p='[{"op":"add", "path":"/data/users.anonymous.enabled", "value":"false"}]' ``` Or you can remove the field completely, thus disabling anonymous access because the default is `false`: ```shell $ kubectl patch -n argocd cm argocd-cm --type=json -p='[{"op":"remove", "path":"/data/users.anonymous.enabled"}]' ``` ### Credits The Argo CD team would like to thank Mark Pim and Andrzej Hajto, who discovered this vulnerability and reported it in a responsible way to us. ### For more information * Open an issue in [the Argo CD issue tracker](https://github.com/argoproj/argo-cd/issues) or [discussions](https://github.com/argoproj/argo-cd/discussions) * Join us on [Slack](https://argoproj.github.io/community/join-slack) in channel #argo-cd

CVE-2022-29165 Affected Github.com/argoproj/argo cd/v2 Versions

4 component(s)
Fixed Versions:
2.3.42.2.92.1.15
Product / Package Ecosystem Affected Versions Fixed Version
github.com/argoproj/argo-cd/v2
Go
≥ 2.3.0
< 2.3.4
2.3.4
github.com/argoproj/argo-cd/v2
Go
≥ 2.2.0
< 2.2.9
2.2.9
github.com/argoproj/argo-cd/v2
Go
< 2.1.15
2.1.15
github.com/argoproj/argo-cd
Go
< 2.1.15
2.1.15

References

Frequently Asked Questions

What is CVE-2022-29165?
CVE-2022-29165 is a security vulnerability in Github.com/argoproj/argo cd/v2 involving Argo CD will blindly trust JWT claims if anonymous access is enabled under CWE-287: Improper Authentication.
Which Github.com/argoproj/argo cd/v2 versions are affected?
Affected versions include releases prior to 2.3.4, 2.2.9, 2.1.15 across affected packages: github.com/argoproj/argo-cd/v2, github.com/argoproj/argo-cd.
What version fixes CVE-2022-29165?
Upgrading to 2.3.4, 2.2.9, 2.1.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/argoproj/argo-cd/v2 affected?
Yes, github.com/argoproj/argo-cd/v2 is affected in releases prior to 2.3.4, 2.2.9, 2.1.15. Upgrade your dependency to 2.3.4, 2.2.9, 2.1.15 or later.
Is github.com/argoproj/argo-cd affected?
Yes, github.com/argoproj/argo-cd is affected in releases prior to 2.1.15. Upgrade your dependency to 2.1.15 or later.
What is the CVSS score of CVE-2022-29165?
CVE-2022-29165 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2022-29165?
CVE-2022-29165 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Go dependencies for CVE-2022-29165?
Run the dependency tree command: 'inspect dependencies for github.com/argoproj/argo-cd/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r642-gv9p-2wjj",
  "modified" : "2022-05-24T20:47:34Z",
  "published" : "2022-05-24T20:47:34Z",
  "aliases" : [ "CVE-2022-29165" ],
  "summary" : "Argo CD will blindly trust JWT claims if anonymous access is enabled",
  "details" : "### Impact\n\nA critical vulnerability has been discovered in Argo CD which would allow unauthenticated users to impersonate as any Argo CD user or role, including the `admin` user, by sending a specifically crafted JSON Web Token (JWT) along with the request. In order for this vulnerability to be exploited, [anonymous access](https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/#anonymous-access) to the Argo CD instance must have been enabled. \n\nIn a default Argo CD installation, anonymous access is disabled. To find out if anonymous access is enabled in your instance, please see the *Workarounds* section of this advisory below.\n\nThe vulnerability can be exploited to impersonate as any user or role, including the built-in `admin` account regardless of whether that account is enabled or disabled. Also, the attacker does not need an account on the Argo CD instance in order to exploit this.\n\nIf anonymous access to the instance is enabled, an attacker can:\n\n* Escalate their privileges, effectively allowing them to gain the same privileges on the cluster as the Argo CD instance, which is cluster admin in a default installation. This will allow the attacker to create, manipulate and delete any resource on the cluster.\n\n* Exfiltrate data by deploying malicious workloads with elevated privileges, thus bypassing any redaction of sensitive data otherwise enforced by the Argo CD API\n\nWe **strongly recommend** that all users of Argo CD update to a version containing this patch as soon as possible, regardless of whether or not anonymous access is enabled in your instance.\n\nPlease see below for a list of versions containing a fix for this vulnerability and any possible workarounds existing for this issue.\n\n### Patches\n\nA patch for this vulnerability has been released in the following Argo CD versions:\n\n* v2.3.4\n* v2.2.9\n* v2.1.15\n\n### Workarounds\n\n#### Disable anonymous access\n\nIf you are not able to upgrade to a patched version quickly, we highly suggest disabling anonymous access if it is enabled. \n\nTo find out whether anonymous access is enabled for your Argo CD instance, you can query the `argocd-cm` ConfigMap in the Argo CD's installation namespace. The below example assumes you have installed Argo CD to the `argocd` namespace:\n\n```shell\n$ kubectl get -n argocd cm argocd-cm -o jsonpath='{.data.users\\.anonymous\\.enabled}'\n```\n\nIf the result of this command is either empty or `\"false\"`, anonymous access to that instance is not enabled. If the result is `\"true\"`, your instance is vulnerable.\n\nTo disable anonymous access, patch the `argocd-cm` ConfigMap to either remove the `users.anonymous.enabled` field or set this field to `\"false\"`. \n\nTo set the field to `\"false\"`:\n\n```shell\n$ kubectl patch -n argocd cm argocd-cm --type=json -p='[{\"op\":\"add\", \"path\":\"/data/users.anonymous.enabled\", \"value\":\"false\"}]'\n```\nOr you can remove the field completely, thus disabling anonymous access because the default is `false`:\n\n```shell\n$ kubectl patch -n argocd cm argocd-cm --type=json -p='[{\"op\":\"remove\", \"path\":\"/data/users.anonymous.enabled\"}]'\n```\n\n### Credits\n\nThe Argo CD team would like to thank Mark Pim and Andrzej Hajto, who discovered this vulnerability and reported it in a responsible way to us.\n\n### For more information\n\n* Open an issue in [the Argo CD issue tracker](https://github.com/argoproj/argo-cd/issues) or [discussions](https://github.com/argoproj/argo-cd/discussions)\n* Join us on [Slack](https://argoproj.github.io/community/join-slack) in channel #argo-cd",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.3.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.2.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.15"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.8.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/security/advisories/GHSA-r642-gv9p-2wjj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29165"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/releases/tag/v2.1.15"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/releases/tag/v2.2.9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/releases/tag/v2.3.4"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/argoproj/argo-cd"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-287", "CWE-290" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-05-24T20:47:34Z",
    "nvd_published_at" : "2022-05-20T15:15:00Z"
  }
}