CVE-2026-41589
Path Traversal Vulnerability in Wish SSH Server
Publication date: 2026-05-07
Last updated on: 2026-05-07
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| charmbracelet | wish | From 2.0.0 (inc) to 2.0.1 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-22 | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-41589 is a path traversal vulnerability in the SCP middleware of the Wish SSH server versions 2.0.0 to before 2.0.1. This vulnerability allows a malicious SCP client to send specially crafted filenames containing '../' sequences, which can bypass the intended root directory restrictions.
As a result, an attacker can read arbitrary files, write files, and create directories outside the configured root directory on the server. This happens because the path validation in the code does not properly enforce containment within the root directory.
The issue was fixed in version 2.0.1 by adding tests for path traversal, improving path validation to prevent traversal, and correcting error handling.
How can this vulnerability impact me? :
This vulnerability can have serious impacts because it allows an attacker with SCP access to the server to read sensitive files such as /etc/passwd or /etc/shadow, write arbitrary files anywhere the server process has write permissions, and create directories outside the intended root.
Such unauthorized file access and modification can lead to data breaches, unauthorized system changes, and potential further exploitation of the server.
The CVSS score of 9.6 (or 9.1 in some reports) indicates a high severity vulnerability with network attack vector, low complexity, and significant confidentiality and integrity impacts.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
Detection of this vulnerability involves identifying attempts to exploit path traversal via the SCP middleware in the wish SSH server. Specifically, look for SCP commands or network traffic containing crafted filenames with "../" sequences that attempt to access or write files outside the intended root directory.
You can monitor SSH and SCP logs for suspicious file paths or unusual file operations outside the configured root directory.
- Use network packet capture tools (e.g., tcpdump or Wireshark) to filter SCP traffic and inspect for filenames containing "../" sequences.
- Example tcpdump command to capture SCP traffic on port 22: sudo tcpdump -i any port 22 -w scp_traffic.pcap
- Analyze captured traffic with Wireshark, filtering for SCP protocol and inspecting file path strings for path traversal patterns.
- Check server-side logs for SCP commands or errors related to file access outside the root directory.
What immediate steps should I take to mitigate this vulnerability?
The primary mitigation step is to upgrade the wish SSH server to version 2.0.1 or later, where the path traversal vulnerability in the SCP middleware has been fixed.
If upgrading immediately is not possible, consider restricting SCP access or disabling the SCP middleware temporarily to prevent exploitation.
Additionally, monitor and audit SCP usage closely for suspicious activity involving file paths with "../" sequences.
Ensure that the server process runs with the least privileges necessary to limit the impact of any potential exploitation.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability allows an attacker to read and write arbitrary files outside the intended root directory on the server, including sensitive files such as /etc/passwd or /etc/shadow.
This unauthorized access and modification of sensitive data could lead to breaches of confidentiality and integrity, which are critical requirements under common standards and regulations like GDPR and HIPAA.
Exploitation of this vulnerability could result in exposure of personal or protected health information, thereby potentially causing non-compliance with these regulations.