CVE-2024-21662: Github.com/argoproj/argo cd/v2 Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-2vgg-9h6w-m454
CVSS 5.4
CWE-307
Published
Advisory Summary

CVE-2024-21662 is a MODERATE (CVSS 5.4) remote code execution vulnerability (CWE-307: Improper Restriction of Excessive Authentication Attempts) affecting Github.com/argoproj/argo cd/v2 libraries in the Go ecosystem. The issue involves bypassing rate limit and brute force protection using cache overflow. Remediation is available by upgrading affected packages to version 2.8.13, 2.9.9, 2.10.4.

CVE-2024-21662 at a Glance

CVE Identifier CVE-2024-21662
GHSA Identifier GHSA-2vgg-9h6w-m454
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-307: Improper Restriction of Excessive Authentication Attempts
Affected Product Github.com/argoproj/argo cd/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.4

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

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

How to Fix CVE-2024-21662

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.8.13
Upgrade github.com/argoproj/argo-cd/v2 to 2.8.13
github.com/argoproj/argo-cd/v2 fixed: 2.9.9
Upgrade github.com/argoproj/argo-cd/v2 to 2.9.9
github.com/argoproj/argo-cd/v2 fixed: 2.10.4
Upgrade github.com/argoproj/argo-cd/v2 to 2.10.4
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-2024-21662, 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.8.13), 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-307: Improper Restriction of Excessive Authentication Attempts, where the product does not implement sufficient measures to prevent multiple failed authentication attempts within a short time frame. 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

### Summary An attacker can effectively bypass the rate limit and brute force protections by exploiting the application's weak cache-based mechanism. This loophole in security can be combined with other vulnerabilities to attack the default admin account. This flaw undermines a previously [patched CVE](https://argo-cd.readthedocs.io/en/stable/security_considerations/#cve-2020-8827-insufficient-anti-automationanti-brute-force) intended to protect against brute-force attacks. ### Details The application's brute force protection relies on a cache mechanism that tracks login attempts for each user. This cache is limited to a `defaultMaxCacheSize` of 1000 entries. An attacker can overflow this cache by bombarding it with login attempts for different users, thereby pushing out the admin account's failed attempts and effectively resetting the rate limit for that account. The brute force protection mechanism's code: ```go if failed && len(failures) >= getMaximumCacheSize() { log.Warnf("Session cache size exceeds %d entries, removing random entry", getMaximumCacheSize()) idx := rand.Intn(len(failures) - 1) var rmUser string i := 0 for key := range failures { if i == idx { rmUser = key delete(failures, key) break } i++ } log.Infof("Deleted entry for user %s from cache", rmUser) } ``` ### PoC 1. Set up the application environment and identify the login page. 2. Execute 4 failed login attempts for the admin account. 3. Run a Burp Intruder attack to populate the cache with login attempts for usernames ranging from 1 to 10000. 4. After 1000 attempts, start monitoring to see if the admin entries in the cache have been cleared. 5. At this point, brute-force the admin account. In just 15 minutes, the PoC was able to perform 230 brute force attempts on the admin account. This rate allows for approximately 1000 requests per hour, effectively rendering the [older CVE](https://argo-cd.readthedocs.io/en/stable/security_considerations/#cve-2020-8827-insufficient-anti-automationanti-brute-force) rate limit patches useless. ### Impact This is a severe vulnerability that enables attackers to perform brute force attacks at an accelerated rate, especially targeting the default admin account.

CVE-2024-21662 Affected Github.com/argoproj/argo cd/v2 Versions

3 component(s)
Fixed Versions:
2.8.132.9.92.10.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/argoproj/argo-cd/v2
Go
< 2.8.13
2.8.13
github.com/argoproj/argo-cd/v2
Go
≥ 2.9.0
< 2.9.9
2.9.9
github.com/argoproj/argo-cd/v2
Go
≥ 2.10.0
< 2.10.4
2.10.4

References

Frequently Asked Questions

What is CVE-2024-21662?
CVE-2024-21662 is a security vulnerability in Github.com/argoproj/argo cd/v2 involving Bypassing Rate Limit and Brute Force Protection Using Cache Overflow under CWE-307: Improper Restriction of Excessive Authentication Attempts.
Which Github.com/argoproj/argo cd/v2 versions are affected?
Affected versions include releases prior to 2.8.13, 2.9.9, 2.10.4 across affected packages: github.com/argoproj/argo-cd/v2.
What version fixes CVE-2024-21662?
Upgrading to 2.8.13, 2.9.9, 2.10.4 (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.8.13, 2.9.9, 2.10.4. Upgrade your dependency to 2.8.13, 2.9.9, 2.10.4 or later.
What is the CVSS score of CVE-2024-21662?
CVE-2024-21662 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2024-21662?
CVE-2024-21662 is classified under CWE-307: Improper Restriction of Excessive Authentication Attempts (The product does not implement sufficient measures to prevent multiple failed authentication attempts within a short time frame.).
How can I check Go dependencies for CVE-2024-21662?
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-2vgg-9h6w-m454",
  "modified" : "2024-03-22T20:05:14Z",
  "published" : "2024-03-18T20:29:05Z",
  "aliases" : [ "CVE-2024-21662" ],
  "summary" : "Bypassing Rate Limit and Brute Force Protection Using Cache Overflow",
  "details" : "### Summary\nAn attacker can effectively bypass the rate limit and brute force protections by exploiting the application's weak cache-based mechanism. This loophole in security can be combined with other vulnerabilities to attack the default admin account. This flaw undermines a previously [patched CVE](https://argo-cd.readthedocs.io/en/stable/security_considerations/#cve-2020-8827-insufficient-anti-automationanti-brute-force) intended to protect against brute-force attacks.\n\n### Details\nThe application's brute force protection relies on a cache mechanism that tracks login attempts for each user. This cache is limited to a `defaultMaxCacheSize` of 1000 entries. An attacker can overflow this cache by bombarding it with login attempts for different users, thereby pushing out the admin account's failed attempts and effectively resetting the rate limit for that account.\n\nThe brute force protection mechanism's code:\n```go\n   if failed && len(failures) >= getMaximumCacheSize() {\n       log.Warnf(\"Session cache size exceeds %d entries, removing random entry\",\n\ngetMaximumCacheSize())\n       idx := rand.Intn(len(failures) - 1)\n       var rmUser string\n       i := 0\n       for key := range failures {\n\n           if i == idx {\n               rmUser = key\n\n               delete(failures, key)\n\nbreak\n\n}\n\ni++ }\n\n       log.Infof(\"Deleted entry for user %s from cache\", rmUser)\n   }\n```\n\n### PoC\n1. Set up the application environment and identify the login page.\n2. Execute 4 failed login attempts for the admin account.\n3. Run a Burp Intruder attack to populate the cache with login attempts for usernames ranging from 1 to 10000.\n4. After 1000 attempts, start monitoring to see if the admin entries in the cache have been cleared.\n5. At this point, brute-force the admin account.\n\nIn just 15 minutes, the PoC was able to perform 230 brute force attempts on the admin account. This rate allows for approximately 1000 requests per hour, effectively rendering the [older CVE](https://argo-cd.readthedocs.io/en/stable/security_considerations/#cve-2020-8827-insufficient-anti-automationanti-brute-force) rate limit patches useless.\n\n### Impact\nThis is a severe vulnerability that enables attackers to perform brute force attacks at an accelerated rate, especially targeting the default admin account.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.8.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.9.0"
      }, {
        "fixed" : "2.9.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.10.0"
      }, {
        "fixed" : "2.10.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/security/advisories/GHSA-2vgg-9h6w-m454"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21662"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/commit/17b0df1168a4c535f6f37e95f25ed7cd81e1fa4d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/commit/6e181d72b31522f886a2afa029d5b26d7912ec7b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/commit/cebb6538f7944c87ca2fecb5d17f8baacc431456"
  }, {
    "type" : "WEB",
    "url" : "https://argo-cd.readthedocs.io/en/stable/security_considerations/#cve-2020-8827-insufficient-anti-automationanti-brute-force"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/argoproj/argo-cd"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-307" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-18T20:29:05Z",
    "nvd_published_at" : "2024-03-18T19:15:06Z"
  }
}