# CVE-2024-45401: stripe-cli Path Traversal vulnerability

> A path traversal flaw in Stripe CLI allows arbitrary file overwrites via malicious plugin archives, requiring an upgrade to mitigate.

- **Severity:** High 7.6 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 5 Sep 2024
- **Updated:** 19 Dec 2024
- **Also known as:** GHSA-fv4g-gwpj-74gr, GO-2024-3119

## What is CVE-2024-45401?

CVE-2024-45401 is a high-severity path traversal vulnerability in stripe-cli, published on 5 Sep 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

stripe-cli is a command-line tool for the payment processor Stripe. A vulnerability exists in stripe-cli starting in version 1.11.1 and prior to version 1.21.3 where a plugin package containing a manifest with a malformed plugin shortname installed using the --archive-url or --archive-path flags can overwrite arbitrary files. The update in version 1.21.3 addresses the path traversal vulnerability by removing the ability to install plugins from an archive URL or path. There has been no evidence of exploitation of this vulnerability.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-45401?

3 open source packages ship an affected version, including github.com/stripe/stripe-cli. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/stripe/stripe-cli` | Go | From 1.11.1 | 1.21.3 |
| `github.com/stripe/stripe-cli` | Go | From 1.11.1 | 1.21.3 |
| `github.com/stripe/stripe-cli` | Go | From 1.11.1 | 1.21.3 |

Products: Stripe Stripe Cli.

## How do I fix CVE-2024-45401?

Upgrade github.com/stripe/stripe-cli to 1.21.3 or later.

## Is CVE-2024-45401 being exploited?

There is no known exploitation of CVE-2024-45401 in the wild and no public exploit code.

## Other vulnerabilities in stripe-cli

- [CVE-2022-24753](https://insights.sbomify.com/CVE-2022-24753/): Code injection in Stripe CLI on windows (high 7.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-45401 and fix it if it is affected.

What it is: CVE-2024-45401 is a high-severity path traversal vulnerability in stripe-cli, published on 5 Sep 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-45401 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/stripe/stripe-cli (Go): affected from 1.11.1; fixed in 1.21.3
- github.com/stripe/stripe-cli (Go): affected from 1.11.1; fixed in 1.21.3
- github.com/stripe/stripe-cli (Go): affected from 1.11.1; fixed in 1.21.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-45401/ (Markdown: https://insights.sbomify.com/CVE-2024-45401/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-45401
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-45401
- OSV: https://osv.dev/vulnerability/CVE-2024-45401

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-45401/
Summaries are generated and may contain mistakes; the official description above is the record.
