/

CVE-2026-102643

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in AsyncSSH SFTP Server Chroot

CVE-2026-102643

Awaiting Analysis

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-50

Impact:

Chroot escape with potential unauthorized file read, file write, and conditional code execution

Severity:

HIGH RISK

(8.8)

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

AsyncSSH's SFTP path mapping can allow an authenticated SFTP user to escape the configured chroot by supplying a path with a particular leading-slash form. This may enable the user to read or write files accessible to the server's operating-system account, and code execution may be possible if suitable targets are writable.

Affected context

The issue occurs in AsyncSSH's SFTPServer.map_path() when client-supplied paths are normalized and then joined with the configured chroot. It affects configurations where the path handling leaves a double-leading-slash form that is treated as absolute during the join. Exploitation requires an authenticated SFTP user and is limited by the operating-system permissions of the account running the server.

Exploit preconditions

  • Attack surface: AsyncSSH SFTP server path handling
  • Required access: An authenticated account with SFTP access
  • Trigger point: Mapping a client-supplied path to the configured chroot
  • Why exploitation is possible: Normalization can preserve a double-leading-slash form, and removing only one leading slash can leave a path that the subsequent join treats as absolute, bypassing the chroot

Why this happens

The path mapping logic does not ensure that the normalized client path remains relative to the configured chroot. POSIX path normalization may preserve a double-leading-slash prefix, and joining that result with the chroot can cause the path to be interpreted as absolute. This is a path traversal issue, mapped primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory; it also relates to CWE-50: Pathname Equivalence, because differing path representations can bypass intended restrictions.

Potential impact

  • An authenticated user may read files accessible to the server account outside the chroot.
  • An authenticated user may modify or create files where the server account has write permission.
  • Code execution could occur if the user can modify a file that is later executed or loaded by another process.
  • The confidentiality and integrity of data available to the server account may be affected.

General mitigation guidance

Defensive patterns focus on enforcing directory containment after path resolution, rather than relying on slash removal or normalization alone.

  • Resolve candidate paths against the configured root and verify they remain within it before performing file operations.
  • Reject or consistently canonicalize ambiguous path forms, including paths with repeated leading separators.
  • Use filesystem APIs and access controls that constrain SFTP operations to a dedicated directory.
  • Run the SFTP service with a minimally privileged operating-system account and limit writable locations.
  • Treat client-supplied paths as untrusted regardless of authentication.

How teams detect issues like this

  • Use static analysis to identify path joins involving client-controlled values without a subsequent containment check.
  • Review path normalization and chroot mapping code for inconsistent handling of leading separators and absolute paths.
  • Add tests and policy checks that cover equivalent path representations and confirm resolved paths remain inside the configured root.
  • Monitor SFTP activity for access attempts outside expected directory boundaries and unexpected changes to sensitive files.

Sources

SourceLink
github.comgithub.com/ronf/asyncssh/commit/d4fc430d37b234cb35f1ba2cca834b2dbe1302cf
github.comgithub.com/ronf/asyncssh/releases/tag/v2.24.1
github.comgithub.com/ronf/asyncssh/security/advisories/GHSA-w29m-45fc-22v9

Frequently asked

questions

An authenticated SFTP user may exploit it if the server uses the affected path-mapping behavior. The resulting file access is constrained by the operating-system permissions of the server account.

The user needs access to the SFTP service and valid authentication. The issue is triggered during server-side handling of an SFTP path.

Resolve each requested path and verify that its final location remains within the configured root before allowing file operations. Do not rely on string normalization or leading-slash removal alone.

Treat client paths as untrusted, test path-equivalence edge cases, enforce filesystem-level restrictions, and run the service with least privilege.

Find out what's already
exploitable in your codebase.