# CVE-2026-41589: Wish has SCP Path Traversal that allows arbitrary file read/write

> A malicious SCP client can read or write arbitrary files on the server via path traversal in the Wish SSH library.

- **Severity:** Critical 9.6 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 May 2026
- **Updated:** 7 May 2026
- **Also known as:** GHSA-xjvp-7243-rg9h, GO-2026-5762

## What is CVE-2026-41589?

CVE-2026-41589 is a critical path traversal vulnerability in charmbracelet wish, published on 7 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Wish is an SSH server with defaults and a collection of middlewares. From version 2.0.0 to before version 2.0.1, the SCP middleware in charm.land/wish/v2 is vulnerable to path traversal attacks. A malicious SCP client can read arbitrary files from the server, write arbitrary files to the server, and create directories outside the configured root directory by sending crafted filenames containing ../ sequences over the SCP protocol. This issue has been patched in version 2.0.1.

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

## Which versions are affected by CVE-2026-41589?

5 open source packages ship an affected version, including github.com/charmbracelet/wish and charm.land/wish/v2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/charmbracelet/wish` | Go | All versions to 1.4.7 | None |
| `github.com/charmbracelet/wish` | Go | All versions to 1.4.7 | None |
| `charm.land/wish/v2` | Go | All versions | 2.0.1 |
| `charm.land/wish/v2` | Go | All versions | 2.0.1 |
| `charm.land/wish/v2` | Go | All versions | 2.0.1 |

Products: Charm Wish.

## How do I fix CVE-2026-41589?

Apply the vendor's patch.

## Is CVE-2026-41589 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-41589 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-41589 and fix it if it is affected.

What it is: CVE-2026-41589 is a critical path traversal vulnerability in charmbracelet wish, published on 7 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-41589 exists.

Affected packages and fixed versions:
- github.com/charmbracelet/wish (Go): affected all versions up to 1.4.7; no fix listed
- github.com/charmbracelet/wish (Go): affected all versions up to 1.4.7; no fix listed
- charm.land/wish/v2 (Go): affected all versions; fixed in 2.0.1
- charm.land/wish/v2 (Go): affected all versions; fixed in 2.0.1
- charm.land/wish/v2 (Go): affected all versions; fixed in 2.0.1

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-2026-41589/ (Markdown: https://insights.sbomify.com/CVE-2026-41589/index.md)
```

## Sources

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

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