/

CVE-2026-53980

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in Wish SSH Git Middleware

CVE-2026-53980

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized access to repositories outside the configured root, including possible data disclosure or modification

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Wish's Git middleware can allow authenticated SSH users to escape the configured repository directory by supplying crafted repository paths. Depending on the Git operation and filesystem permissions, this may let them read or modify repositories outside the intended root.

Affected context

The vulnerability affects Wish deployments using the Git middleware with a configured repository root. The middleware's forward-slash-count containment check can fail to identify paths that traverse outside that root, including single-depth traversal paths and, on Windows, backslash-based paths.

Exploit preconditions

  • Attack surface: The Git middleware exposed over SSH
  • Required access: An authenticated SSH account able to invoke Git operations through the middleware
  • Trigger point: The middleware processes a supplied repository path for git-upload-pack, git-upload-archive, or git-receive-pack
  • Why exploitation is possible: A flawed forward-slash-count check may not detect paths that resolve outside the configured repository directory

Why this happens

The middleware uses a separator-counting check to assess whether a repository path remains within an intended directory. Counting forward slashes does not reliably establish path containment: traversal segments can escape the root, and Windows backslashes can bypass a check focused on forward slashes. This is a path traversal weakness, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Potential impact

  • Authenticated users may read repository data outside the configured root through Git read operations.
  • Users may modify repositories outside the intended root through Git write operations, subject to the service's permissions.
  • Repository confidentiality or integrity could be compromised.
  • Additional systems or workflows relying on affected repositories could be exposed to follow-on risk.

General mitigation guidance

Mitigation patterns focus on enforcing directory boundaries independently of path formatting:

  • Resolve and normalize repository paths using platform-aware filesystem APIs, then verify that the resolved target remains beneath the canonical repository root.
  • Reject traversal segments and unexpected path forms rather than relying on separator counts.
  • Use secure-by-default path handling and avoid allowing clients to select arbitrary filesystem locations.
  • Restrict SSH access and apply least-privilege filesystem permissions to repository operations.
  • Separate read and write capabilities where practical, and limit each account to the repositories it needs.

How teams detect issues like this

  • Review path-handling code for checks based on separator counts, string prefixes, or assumptions about slash direction.
  • Use static analysis rules to flag user-controlled paths passed to filesystem or Git operations without canonical containment validation.
  • Test path validation across supported operating systems and with both separator styles.
  • Enforce policies requiring canonical-path containment checks and least-privilege access for Git middleware.
  • Automated code review tools may help identify risky path construction and validation patterns.

Sources

SourceLink
github.comgithub.com/charmbracelet/wish/commit/533db0daa90446b0d4ae3284877179c37e0cc48e
github.comgithub.com/charmbracelet/wish/releases/tag/v2.0.5
vulncheck.comvulncheck.com/advisories/charmbracelet-wish-path-traversal-via-git-middleware

Frequently asked

questions

Exploitation requires an authenticated SSH user who can reach the Git middleware and invoke the relevant Git operations.

Crafted repository paths may reach repositories outside the configured root. Reading or modifying them depends on the operation used and the service account's filesystem permissions.

Resolve paths with platform-aware APIs and confirm the canonical target is contained within the canonical repository root before performing Git operations.

Avoid string-count or separator-specific containment checks, test path handling across supported platforms, and restrict SSH and filesystem privileges to the minimum required.

Find out what's already
exploitable in your codebase.