CVE-2023-23947: Github.com/argoproj/argo cd Users With Any Cluster Secret Vulnerability

CRITICAL
Advisory Identifier: GHSA-3jfq-742w-xg8j
CVSS 9.1
CWE-863
Published
Advisory Summary

CVE-2023-23947 is a CRITICAL (CVSS 9.1) users with any cluster secret vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/argoproj/argo cd libraries in the Go ecosystem. The issue involves users with any cluster secret update access may update out-of-bounds cluster secrets. Remediation is available by upgrading affected packages to version 2.3.17, 2.4.23, 2.5.11, 2.6.2.

CVE-2023-23947 at a Glance

CVE Identifier CVE-2023-23947
GHSA Identifier GHSA-3jfq-742w-xg8j
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-863: Incorrect Authorization
Affected Product Github.com/argoproj/argo cd
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.1

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
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-2023-23947

To remediate this vulnerability, upgrade all affected Github.com/argoproj/argo cd 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 fixed: 2.3.17
Upgrade github.com/argoproj/argo-cd to 2.3.17
github.com/argoproj/argo-cd fixed: 2.4.23
Upgrade github.com/argoproj/argo-cd to 2.4.23
github.com/argoproj/argo-cd fixed: 2.5.11
Upgrade github.com/argoproj/argo-cd to 2.5.11
github.com/argoproj/argo-cd fixed: 2.6.2
Upgrade github.com/argoproj/argo-cd to 2.6.2
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

How to Check if You Are Affected

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

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

Analyze the terminal output to locate any version of Github.com/argoproj/argo cd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.17), 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/argoproj/argo cd, 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 All Argo CD versions starting with v2.3.0-rc1 are vulnerable to an improper authorization bug which allows users who have the ability to update at least one cluster secret to update any cluster secret. The attacker could use this access to escalate privileges (potentially controlling Kubernetes resources) or to break Argo CD functionality (by preventing connections to external clusters). #### How the Attack Works Argo CD stores [cluster access configurations](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#clusters) as Kubernetes Secrets. To take advantage of the vulnerability, an attacker must know the server URL for the cluster secret they want to modify. The attacker must be authenticated with the Argo CD API server, and they must be authorized to update at least one ([non project-scoped](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#project-scoped-repositories-and-clusters)) cluster. Then they must craft a malicious request to the Argo CD API server. #### Removing Deployment Restrictions A cluster Secret's `clusterResources` field determines whether Argo CD users may deploy cluster-scoped resources to that cluster. The `namespaces` field determines the namespaces to which Argo CD users may deploy resources. You can use this command to determine whether any of your cluster configurations employ these restrictions (replace `argocd` with the namespace of your Argo CD installation): ```shell kubectl get secret -n argocd -l 'argocd.argoproj.io/secret-type=cluster' -ojson | jq '.items | map(.data |= with_entries(.value |= @base64d)) | # base64-decode secrets map(select(.data | ( (.clusterResources != null and .clusterResources == "false") or # we deny cluster-scoped resource management (.namespaces != null and .namespaces != "") # we are only managing certain clusters )) | .metadata.name)' ``` The `clusterResources` and `namespaces` fields are one line of defense against unauthorized management of Kubernetes resources. Users should also have AppProject and RBAC restrictions in place. If `clusterResources: "false"` or `namespaces: "some,namespaces"` are the _only_ mechanisms preventing an attacker from maliciously managing certain resources via Argo CD, then this vulnerability could allow that attacker to manage out-of-bounds resources via Argo CD (create, get, update, delete). #### Modifying Connection Parameters Cluster secrets also hold client configuration for connecting to the remote cluster. One option is to skip TLS certificate verification. An attacker could disable certificate verification in an effort to achieve a malicious-in-the-middle (MITM) attack. Alternatively, an attacker could apply an invalid configuration (for example, by setting an invalid bearer token) and achieve a denial-of-service by preventing Argo CD from managing the target cluster. #### Changing Unscoped Clusters to be Scoped The vulnerability also allows an attacker to modify a previously-unscoped cluster and make it [scoped](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#project-scoped-repositories-and-clusters). This is important if you are using `permitOnlyProjectScopedClusters: true` in a project under which the attacker can deploy. By scoping a previously-unscoped cluster under that project, they can grant themselves the ability to manage resources on the target cluster. ### Patches A patch for this vulnerability has been released in the following Argo CD versions: * v2.6.2 * v2.5.11 * v2.4.23 * v2.3.17 ### Workarounds The best way to mitigate the vulnerability is to upgrade. The following two sections explain other ways to mitigate the vulnerability if you are currently unable to upgrade. #### Limit Users with Cluster Update Access The only complete mitigation besides upgrading is to modify your RBAC configuration to completely revoke all `clusters, update` access. To exploit this vulnerability, an attacker must have access to update at least one cluster configuration. Check your [RBAC configuration](https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/), for lines like this: ``` p, role:developers, clusters, update, *, allow p, role:developers, clusters, *, *, allow p, role:developers, *, update, *, allow ``` Revoke `clusters, update` access for any users who do not absolutely need that access. #### Restrict Resource Management via AppProjects and RBAC [AppProjects](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#projects) are a primary tool to restrict what resources may be managed via Argo CD. You can use the `destinations` and `clusterResourceWhitelist` fields to apply similar restrictions as the `namespaces` and `clusterResources` fields described above. ```yaml apiVersion: argoproj.io/v1alpha1 kind: AppProject spec: destinations: # Only allow Applications managed by this AppProject to manage to the `allowed-namespace` namespace. - namespace: 'allowed-namespace' server: 'https://your-server' # Do not allow Applications managed by this AppProject to manage any cluster-scoped resources. clusterResourceWhitelist: [] ``` Along with adding AppProject restrictions, make sure that your RBAC restrictions are strict enough. For example, limit `projects, update` access to Argo CD administrators only. Also use the `{project}` field in `applications, *, {project}/{application}` field to limit users' access to certain, restricted, AppProjects. AppProject restrictions can only prevent Applications from managing out-of-bounds resources. It cannot prevent an attacker from maliciously changing cluster connection TLS configuration. ### 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-2023-23947 Affected Github.com/argoproj/argo cd Versions

4 component(s)
Fixed Versions:
2.3.172.4.232.5.112.6.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/argoproj/argo-cd
Go
≥ 2.3.0
< 2.3.17
2.3.17
github.com/argoproj/argo-cd
Go
≥ 2.4.0
< 2.4.23
2.4.23
github.com/argoproj/argo-cd
Go
≥ 2.5.0
< 2.5.11
2.5.11
github.com/argoproj/argo-cd
Go
≥ 2.6.0
< 2.6.2
2.6.2

References

Frequently Asked Questions

What is CVE-2023-23947?
CVE-2023-23947 is a security vulnerability in Github.com/argoproj/argo cd involving Users with any cluster secret update access may update out-of-bounds cluster secrets under CWE-863: Incorrect Authorization.
Which Github.com/argoproj/argo cd versions are affected?
Affected versions include releases prior to 2.3.17, 2.4.23, 2.5.11, 2.6.2 across affected packages: github.com/argoproj/argo-cd.
What version fixes CVE-2023-23947?
Upgrading to 2.3.17, 2.4.23, 2.5.11, 2.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/argoproj/argo-cd affected?
Yes, github.com/argoproj/argo-cd is affected in releases prior to 2.3.17, 2.4.23, 2.5.11, 2.6.2. Upgrade your dependency to 2.3.17, 2.4.23, 2.5.11, 2.6.2 or later.
What is the CVSS score of CVE-2023-23947?
CVE-2023-23947 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2023-23947?
CVE-2023-23947 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2023-23947?
Run the dependency tree command: 'inspect dependencies for github.com/argoproj/argo-cd'. 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-3jfq-742w-xg8j",
  "modified" : "2023-02-16T20:47:25Z",
  "published" : "2023-02-16T20:47:25Z",
  "aliases" : [ "CVE-2023-23947" ],
  "summary" : "Users with any cluster secret update access may update out-of-bounds cluster secrets",
  "details" : "### Impact\n\nAll Argo CD versions starting with v2.3.0-rc1 are vulnerable to an improper authorization bug which allows users who have the ability to update at least one cluster secret to update any cluster secret.\n\nThe attacker could use this access to escalate privileges (potentially controlling Kubernetes resources) or to break Argo CD functionality (by preventing connections to external clusters).\n\n#### How the Attack Works\n\nArgo CD stores [cluster access configurations](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#clusters) as Kubernetes Secrets. To take advantage of the vulnerability, an attacker must know the server URL for the cluster secret they want to modify. \n\nThe attacker must be authenticated with the Argo CD API server, and they must be authorized to update at least one ([non project-scoped](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#project-scoped-repositories-and-clusters)) cluster. Then they must craft a malicious request to the Argo CD API server.\n\n#### Removing Deployment Restrictions\n\nA cluster Secret's `clusterResources` field determines whether Argo CD users may deploy cluster-scoped resources to that cluster. The `namespaces` field determines the namespaces to which Argo CD users may deploy resources.\n\nYou can use this command to determine whether any of your cluster configurations employ these restrictions (replace `argocd` with the namespace of your Argo CD installation):\n\n```shell\nkubectl get secret -n argocd -l 'argocd.argoproj.io/secret-type=cluster' -ojson | jq '.items |\n  map(.data |= with_entries(.value |= @base64d)) |  # base64-decode secrets\n  map(select(.data | (\n    (.clusterResources != null and .clusterResources == \"false\") or # we deny cluster-scoped resource management\n    (.namespaces != null and .namespaces != \"\")                     # we are only managing certain clusters\n  )) | .metadata.name)'\n```\n\nThe `clusterResources` and `namespaces` fields are one line of defense against unauthorized management of Kubernetes resources. Users should also have AppProject and RBAC restrictions in place.\n\nIf `clusterResources: \"false\"` or `namespaces: \"some,namespaces\"` are the _only_ mechanisms preventing an attacker from maliciously managing certain resources via Argo CD, then this vulnerability could allow that attacker to manage out-of-bounds resources via Argo CD (create, get, update, delete).\n\n#### Modifying Connection Parameters\n\nCluster secrets also hold client configuration for connecting to the remote cluster. One option is to skip TLS certificate verification. An attacker could disable certificate verification in an effort to achieve a malicious-in-the-middle (MITM) attack.\n\nAlternatively, an attacker could apply an invalid configuration (for example, by setting an invalid bearer token) and achieve a denial-of-service by preventing Argo CD from managing the target cluster.\n\n#### Changing Unscoped Clusters to be Scoped\n\nThe vulnerability also allows an attacker to modify a previously-unscoped cluster and make it [scoped](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#project-scoped-repositories-and-clusters). This is important if you are using `permitOnlyProjectScopedClusters: true` in a project under which the attacker can deploy. By scoping a previously-unscoped cluster under that project, they can grant themselves the ability to manage resources on the target cluster.\n\n### Patches\n\nA patch for this vulnerability has been released in the following Argo CD versions:\n\n* v2.6.2\n* v2.5.11\n* v2.4.23\n* v2.3.17\n\n### Workarounds\n\nThe best way to mitigate the vulnerability is to upgrade. The following two sections explain other ways to mitigate the vulnerability if you are currently unable to upgrade.\n\n#### Limit Users with Cluster Update Access\n\nThe only complete mitigation besides upgrading is to modify your RBAC configuration to completely revoke all `clusters, update` access.\n\nTo exploit this vulnerability, an attacker must have access to update at least one cluster configuration. Check your [RBAC configuration](https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/), for lines like this:\n\n```\np, role:developers, clusters, update, *, allow\np, role:developers, clusters, *, *, allow\np, role:developers, *, update, *, allow\n```\n\nRevoke `clusters, update` access for any users who do not absolutely need that access.\n\n#### Restrict Resource Management via AppProjects and RBAC\n\n[AppProjects](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#projects) are a primary tool to restrict what resources may be managed via Argo CD.\n\nYou can use the `destinations` and `clusterResourceWhitelist` fields to apply similar restrictions as the `namespaces` and `clusterResources` fields described above.\n\n```yaml\napiVersion: argoproj.io/v1alpha1\nkind: AppProject\nspec:\n  destinations:\n  # Only allow Applications managed by this AppProject to manage to the `allowed-namespace` namespace.\n  - namespace: 'allowed-namespace'\n    server: 'https://your-server'\n  # Do not allow Applications managed by this AppProject to manage any cluster-scoped resources.\n  clusterResourceWhitelist: []\n```\n\nAlong with adding AppProject restrictions, make sure that your RBAC restrictions are strict enough.\n\nFor example, limit `projects, update` access to Argo CD administrators only. Also use the `{project}` field in `applications, *, {project}/{application}` field to limit users' access to certain, restricted, AppProjects. \n\nAppProject restrictions can only prevent Applications from managing out-of-bounds resources. It cannot prevent an attacker from maliciously changing cluster connection TLS configuration.\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\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.3.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.4.0"
      }, {
        "fixed" : "2.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0"
      }, {
        "fixed" : "2.5.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.6.0"
      }, {
        "fixed" : "2.6.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/security/advisories/GHSA-3jfq-742w-xg8j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-23947"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/commit/fbb0b99b1ac3361b253052bd30259fa43a520945"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/argoproj/argo-cd"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-16T20:47:25Z",
    "nvd_published_at" : "2023-02-16T18:15:00Z"
  }
}