CVE-2022-24753: Github.com/stripe/stripe cli Code Injection Vulnerability

HIGH
Advisory Identifier: GHSA-4cx6-fj7j-pjx9
CVSS 7.7
CWE-78
Published
Advisory Summary

CVE-2022-24753 is a HIGH (CVSS 7.7) code injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Github.com/stripe/stripe cli libraries in the Go ecosystem. The issue involves code injection in stripe cli on windows. Remediation is available by upgrading affected packages to version 1.7.13.

CVE-2022-24753 at a Glance

CVE Identifier CVE-2022-24753
GHSA Identifier GHSA-4cx6-fj7j-pjx9
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Github.com/stripe/stripe cli
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.7

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

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

How to Fix CVE-2022-24753

To remediate this vulnerability, upgrade all affected Github.com/stripe/stripe cli 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/stripe/stripe-cli fixed: 1.7.13
Upgrade github.com/stripe/stripe-cli to 1.7.13
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/stripe/stripe-cli

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-24753, inspect your project dependencies for Github.com/stripe/stripe cli:

inspect dependencies for github.com/stripe/stripe-cli

Analyze the terminal output to locate any version of Github.com/stripe/stripe cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Github.com/stripe/stripe cli, 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 vulnerability in Stripe CLI exists on Windows when certain commands are run in a directory where an attacker has planted files. The commands are `stripe login`, `stripe config -e`, `stripe community`, and `stripe open`. MacOS and Linux are unaffected. An attacker who successfully exploits the vulnerability can run arbitrary code in the context of the current user. The update addresses the vulnerability by throwing an error in these situations before the code can run. There has been no evidence of exploitation of this vulnerability. ### Recommendation Upgrade to Stripe CLI v1.7.13. ### Acknowledgments Thanks to [trungpabc](https://hackerone.com/trungpabc) for reporting the issue. ### For more information Email us at [security@stripe.com](mailto:security@stripe.com).

CVE-2022-24753 Affected Github.com/stripe/stripe cli Versions

1 component(s)
Fixed Versions:
1.7.13
Product / Package Ecosystem Affected Versions Fixed Version
github.com/stripe/stripe-cli
Go
< 1.7.13
1.7.13

References

Frequently Asked Questions

What is CVE-2022-24753?
CVE-2022-24753 is a security vulnerability in Github.com/stripe/stripe cli involving Code injection in Stripe CLI on windows under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Github.com/stripe/stripe cli versions are affected?
Affected versions include releases prior to 1.7.13 across affected packages: github.com/stripe/stripe-cli.
What version fixes CVE-2022-24753?
Upgrading to 1.7.13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/stripe/stripe-cli affected?
Yes, github.com/stripe/stripe-cli is affected in releases prior to 1.7.13. Upgrade your dependency to 1.7.13 or later.
What is the CVSS score of CVE-2022-24753?
CVE-2022-24753 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2022-24753?
CVE-2022-24753 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2022-24753?
Run the dependency tree command: 'inspect dependencies for github.com/stripe/stripe-cli'. 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-4cx6-fj7j-pjx9",
  "modified" : "2022-03-18T21:10:48Z",
  "published" : "2022-03-10T18:17:50Z",
  "aliases" : [ "CVE-2022-24753" ],
  "summary" : "Code injection in Stripe CLI on windows",
  "details" : "### Impact\nA vulnerability in Stripe CLI exists on Windows when certain commands are run in a directory where an attacker has planted files. The commands are `stripe login`, `stripe config -e`, `stripe community`, and `stripe open`. MacOS and Linux are unaffected.\n\nAn attacker who successfully exploits the vulnerability can run arbitrary code in the context of the current user. The update addresses the vulnerability by throwing an error in these situations before the code can run.\n\nThere has been no evidence of exploitation of this vulnerability.\n\n### Recommendation\nUpgrade to Stripe CLI v1.7.13.\n\n### Acknowledgments\nThanks to [trungpabc](https://hackerone.com/trungpabc) for reporting the issue.\n\n### For more information\nEmail us at [security@stripe.com](mailto:security@stripe.com).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/stripe/stripe-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.7.13"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/stripe/stripe-cli/security/advisories/GHSA-4cx6-fj7j-pjx9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24753"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stripe/stripe-cli/commit/be38da5c0191adb77f661f769ffff2fbc7ddf6cd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/stripe/stripe-cli"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-10T18:17:50Z",
    "nvd_published_at" : "2022-03-09T23:15:00Z"
  }
}