AsyncSSH
AsyncSSH: SFTPServer Chroot Escape
AsyncSSH is a Python package which provides an asynchronous client and server implementation of the SSHv2 protocol on top of the Python asyncio framework. Prior to 2.24.1, SFTPServer.map_path() uses posixpath.normpath() on a client-supplied path and removes only one leading slash before passing the result to posixpath.join() with the configured chroot. An authenticated SFTP user can supply a path beginning with exactly two slash characters, causing POSIX normalization to preserve the double-leading-slash form and the subsequent join to treat the remaining pathname as absolute. This bypasses the SFTP chroot and permits reads and writes with the operating-system permissions of the account running the server, which may enable code execution depending on writable targets. This issue is fixed in version 2.24.1.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 2.24.1
Fixed in 2.24.1
Mitigation
Upgrade asyncssh to 2.24.1 or later.
References
- Vendor advisory github.com/ronf/asyncssh/security/advisories/G…
- Patch github.com/ronf/asyncssh/commit/d4fc430d37b234…
- Release notes github.com/ronf/asyncssh/releases/tag/v2.24.1
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.