CVE-2022-31102: Github.com/argoproj/argo cd Cross-Site Scripting Vulnerability

LOW
Advisory Identifier: GHSA-pmjg-52h9-72qv
CVSS 2.6
CWE-79
Published
Advisory Summary

CVE-2022-31102 is a LOW (CVSS 2.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/argoproj/argo cd libraries in the Go ecosystem. The issue involves argo cd sso users vulnerable to cross-site scripting. Remediation is available by upgrading affected packages to version 2.3.6, 2.4.5.

CVE-2022-31102 at a Glance

CVE Identifier CVE-2022-31102
GHSA Identifier GHSA-pmjg-52h9-72qv
Severity LOW
CVSS v3.1 Base Score 2.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Github.com/argoproj/argo cd
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 2.6

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

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

How to Fix CVE-2022-31102

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.6
Upgrade github.com/argoproj/argo-cd to 2.3.6
github.com/argoproj/argo-cd fixed: 2.4.5
Upgrade github.com/argoproj/argo-cd to 2.4.5
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-2022-31102, 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.6), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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 versions of Argo CD starting with 2.3.0 are vulnerable to a cross-site scripting (XSS) bug which could allow an attacker to inject arbitrary JavaScript in the `/auth/callback` page in a victim's browser. This vulnerability only affects Argo CD instances which have SSO enabled. The exploit also assumes the attacker has 1) access to the API server's encryption key, 2) a method to add a cookie to the victim's browser, and 3) the ability to convince the victim to visit a malicious `/auth/callback` link. The vulnerability is classified as low severity, because access to the API server's encryption key already grants a high level of access. Exploiting the XSS would allow the attacker to impersonate the victim, but would not grant any privileges which the attacker could not otherwise gain using the encryption key. ### Patches A patch for this vulnerability has been released in the following Argo CD versions: * v2.4.5 * v2.3.6 ### Workarounds There is no workaround besides upgrading. ### Credits Disclosed by ADA Logics in a 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](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-31102 Affected Github.com/argoproj/argo cd Versions

2 component(s)
Fixed Versions:
2.3.62.4.5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/argoproj/argo-cd
Go
≥ 2.3.0
< 2.3.6
2.3.6
github.com/argoproj/argo-cd
Go
≥ 2.4.0
< 2.4.5
2.4.5

References

Frequently Asked Questions

What is CVE-2022-31102?
CVE-2022-31102 is a security vulnerability in Github.com/argoproj/argo cd involving Argo CD SSO users vulnerable to Cross-site Scripting under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Github.com/argoproj/argo cd versions are affected?
Affected versions include releases prior to 2.3.6, 2.4.5 across affected packages: github.com/argoproj/argo-cd.
What version fixes CVE-2022-31102?
Upgrading to 2.3.6, 2.4.5 (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.6, 2.4.5. Upgrade your dependency to 2.3.6, 2.4.5 or later.
What is the CVSS score of CVE-2022-31102?
CVE-2022-31102 has a CVSS v3.1 base score of 2.6 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:N/I:L/A:N.
What CWE is associated with CVE-2022-31102?
CVE-2022-31102 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Go dependencies for CVE-2022-31102?
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-pmjg-52h9-72qv",
  "modified" : "2022-07-21T15:54:45Z",
  "published" : "2022-07-12T22:11:16Z",
  "aliases" : [ "CVE-2022-31102" ],
  "summary" : "Argo CD SSO users vulnerable to Cross-site Scripting",
  "details" : "### Impact\n\nAll versions of Argo CD starting with 2.3.0 are vulnerable to a cross-site scripting (XSS) bug which could allow an attacker to inject arbitrary JavaScript in the `/auth/callback` page in a victim's browser. \n\nThis vulnerability only affects Argo CD instances which have SSO enabled.\n\nThe exploit also assumes the attacker has 1) access to the API server's encryption key, 2) a method to add a cookie to the victim's browser, and 3) the ability to convince the victim to visit a malicious `/auth/callback` link.\n\nThe vulnerability is classified as low severity, because access to the API server's encryption key already grants a high level of access. Exploiting the XSS would allow the attacker to impersonate the victim, but would not grant any privileges which the attacker could not otherwise gain using the encryption key.\n\n### Patches\n\nA patch for this vulnerability has been released in the following Argo CD versions:\n\n* v2.4.5\n* v2.3.6\n\n### Workarounds\n\nThere is no workaround besides upgrading.\n\n### Credits\n\nDisclosed by ADA Logics in a 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.\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:H/PR:H/UI:R/S:C/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.3.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/argoproj/argo-cd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.4.0"
      }, {
        "fixed" : "2.4.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/security/advisories/GHSA-pmjg-52h9-72qv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31102"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/commit/3800a1e49d1d5a00a6692fee83396a37a6abe89a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/commit/8d5119b1e3038a2c1d8b651cb242525e9e734c4c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/argoproj/argo-cd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/releases/tag/v2.3.6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/argoproj/argo-cd/releases/tag/v2.4.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-07-12T22:11:16Z",
    "nvd_published_at" : "2022-07-12T22:15:00Z"
  }
}