CVE-2026-54591: asyncssh Arbitrary File Write Vulnerability via SCP Path Traversal
Summary
CVE-2026-54591: asyncssh has SCP Path Traversal to Arbitrary File Write. Affects asyncssh versions < 2.23.1. Fixed in 2.23.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
asyncssh is a Python library that provides an asynchronous SSH client and server implementation. It is widely used for secure file transfers and remote command execution. The library supports SCP (Secure Copy Protocol), allowing users to transfer files securely over SSH. However, a critical vulnerability has been identified in all versions of asyncssh up to 2.23.0, which allows a malicious SSH server to exploit the SCP functionality and write arbitrary files on the client's filesystem.
Vulnerability Detail
The vulnerability arises from the lack of sanitization of server-provided filenames during the SCP file transfer process. An attacker can send filenames containing traversal sequences (e.g., '../') to escape the intended target directory. This can lead to overwriting sensitive files such as ~/.bashrc, ~/.profile, or ~/.ssh/authorized_keys, potentially allowing for remote code execution. The vulnerability is classified under the same category as CVE-2019-6111, which affected OpenSSH. The technical flaw lies in the way asyncssh processes the filenames without proper validation, enabling directory traversal attacks.
How To Fix
Latest published version: 2.24.1 as of 23 Oct 2026
pip install --upgrade "asyncssh==2.24.1"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.23.1
This is the first release that contains the fix.
pip install --upgrade "asyncssh==2.23.1"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can avoid using asyncssh for SCP transfers until they can update to the patched version. Additionally, ensure that the SSH server you connect to is trusted and does not allow untrusted file transfers.
Conclusion
The asyncssh library has a critical vulnerability that allows arbitrary file writes through SCP due to insufficient filename sanitization. Users are strongly advised to update to version 2.23.1 or later to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor and identify vulnerabilities in your applications.
See every vulnerability recorded for asyncssh →
FAQ
The CVSS score of this vulnerability is 8.1, indicating a high severity level.
All versions of asyncssh up to and including 2.23.0 are affected by this vulnerability.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Without requiring access to the code or installation, you can check your application's Pipfile.lock for vulnerabilities.
An attacker can exploit this vulnerability to overwrite critical files on the client's filesystem, potentially leading to remote code execution and unauthorized access.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
References
Related vulnerabilities
Recent vulnerabilities recorded for asyncssh.