CVE-2026-54591
AsyncSSH: SCP Path Traversal to Arbitrary File Write
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.23.1, a malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences because _parse_cd_args in scp.py returns server-provided names verbatim and _recv_files joins them to the destination path without enforcing the target directory boundary. This issue is fixed in version 2.23.1.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.1
AsyncSSH: SCP Path Traversal to Arbitrary File Write
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.23.1, a malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences because _parse_cd_args in scp.py returns server-provided names verbatim and _recv_files joins them to the destination path without enforcing the target directory boundary. This issue is fixed in version 2.23.1.
- Record
CVE-2026-54591- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Weakness
- CWE-22
- Updated
- 2026-11-02
EUVDEUVD-2026-42399
8.1
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.23.1, a malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences because _parse_cd_args in scp.py returns server-provided names verbatim and _recv_files joins them to the destination path without enforcing the target directory boundary. This issue is fixed in version 2.23.1.
- Record
EUVD-2026-42399- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-2wxc-x7rj-hg8f
8.1
asyncssh has SCP Path Traversal to Arbitrary File Write
| | | |---|---| | Product | asyncssh (all versions through 2.23.0) | | Related | CVE-2019-6111 (same class in OpenSSH) | | Fix | AsyncSSH 2.23.1 |
A malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences. The SCP receive path does not currently sanitize server-provided filenames. By chaining directory traversals via the D (directory) action, an attacker can escape any target directory and overwrite ~/.bashrc, ~/.ssh/rc, or ~/.ssh/authorized_keys, achieving code execution. This is the same vulnerability class as CVE-2019-6111. The mitigation applied in OpenSSH does not appear to have been adopted in asyncssh.
Steps to exploit:
Step 1 - Normal usage: Application calls await asyncssh.scp((conn, 'file'), '/home/user/downloads/'). This is the standard, documented API.
Step 2 - SCP protocol: asyncssh opens an SSH exec channel, runs scp -f file. The server controls the filename field:
C0644 100 ../pwned.txt\n (simple traversal)
D0755 0 ..\n (traverse up, repeat as needed)
C0644 47 .bashrc\n (write payload)
E\n
Step 3 - _parse_cd_args (scp.py:134-142) returns the filename verbatim:
def _parse_cd_args(args: bytes) -> Tuple[int, int, bytes]:
permissions, size, name = args.split(None, 2)
return int(permissions, 8), int(size), name # no sanitization
The returned name is not passed through basename() and is not checked for .. or / components.
Step 4 - _recv_files (scp.py:706-713) joins the unsanitized name:
new_dstpath = posixpath.join(dstpath, name)
With dstpath=b'/home/user/downloads/subdir' and name=b'../pwned.txt', this resolves to /home/user/downloads/pwned.txt, outside the target.
Step 5 - File write: _recv_file opens the traversed path via self._fs.open(dstpath, 'wb') and writes attacker-controlled content. The resolved path is not checked against the target directory boundary.
Step 6 - RCE chains:
| Target | Execution trigger | Reliability |
|---|---|---|
| ~/.bashrc | Next terminal open | High |
| ~/.profile | Next login | High |
| ~/.ssh/rc | Next SSH connection (requires sshd) | High |
| ~/.ssh/authorized_keys | Attacker logs in with command= | Medium |
Reproduction:
Link to reproduction script: path_traversal_poc.zip
docker build -t asyncssh-scp-traversal -f Dockerfile .
docker run --rm asyncssh-scp-traversal
The attached poc_scp_traversal.py starts a malicious SSH server in-process using asyncssh's own API, then downloads from it via asyncssh.scp().
Expected Output:
<img width="1400" height="815" alt="image" src="https://github.com/user-attachments/assets/496745e4-d11d-4ed8-bddd-d15dd13d1751" />
- Record
GHSA-2wxc-x7rj-hg8f- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Weakness
- CWE-22
- Updated
- 2026-11-02
NVD
8.1
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.23.1, a malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences because _parse_cd_args in scp.py returns server-provided names verbatim and _recv_files joins them to the destination path without enforcing the target directory boundary. This issue is fixed in version 2.23.1.
- Record
CVE-2026-54591- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Weakness
- CWE-22
- Updated
- 2026-11-02
OSV
8.1
AsyncSSH: SCP Path Traversal to Arbitrary File Write
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.23.1, a malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences because _parse_cd_args in scp.py returns server-provided names verbatim and _recv_files joins them to the destination path without enforcing the target directory boundary. This issue is fixed in version 2.23.1.
- Record
CVE-2026-54591- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-54591
8.1
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.23.1, a malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences because _parse_cd_args in scp.py returns server-provided names verbatim and _recv_files joins them to the destination path without enforcing the target directory boundary. This issue is fixed in version 2.23.1.
- Record
DEBIAN-CVE-2026-54591- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Updated
- 2026-11-02
OSVGHSA-2wxc-x7rj-hg8f
8.1
asyncssh has SCP Path Traversal to Arbitrary File Write
| | | |---|---| | Product | asyncssh (all versions through 2.23.0) | | Related | CVE-2019-6111 (same class in OpenSSH) | | Fix | AsyncSSH 2.23.1 |
A malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences. The SCP receive path does not currently sanitize server-provided filenames. By chaining directory traversals via the D (directory) action, an attacker can escape any target directory and overwrite ~/.bashrc, ~/.ssh/rc, or ~/.ssh/authorized_keys, achieving code execution. This is the same vulnerability class as CVE-2019-6111. The mitigation applied in OpenSSH does not appear to have been adopted in asyncssh.
Steps to exploit:
Step 1 - Normal usage: Application calls await asyncssh.scp((conn, 'file'), '/home/user/downloads/'). This is the standard, documented API.
Step 2 - SCP protocol: asyncssh opens an SSH exec channel, runs scp -f file. The server controls the filename field:
C0644 100 ../pwned.txt\n (simple traversal)
D0755 0 ..\n (traverse up, repeat as needed)
C0644 47 .bashrc\n (write payload)
E\n
Step 3 - _parse_cd_args (scp.py:134-142) returns the filename verbatim:
def _parse_cd_args(args: bytes) -> Tuple[int, int, bytes]:
permissions, size, name = args.split(None, 2)
return int(permissions, 8), int(size), name # no sanitization
The returned name is not passed through basename() and is not checked for .. or / components.
Step 4 - _recv_files (scp.py:706-713) joins the unsanitized name:
new_dstpath = posixpath.join(dstpath, name)
With dstpath=b'/home/user/downloads/subdir' and name=b'../pwned.txt', this resolves to /home/user/downloads/pwned.txt, outside the target.
Step 5 - File write: _recv_file opens the traversed path via self._fs.open(dstpath, 'wb') and writes attacker-controlled content. The resolved path is not checked against the target directory boundary.
Step 6 - RCE chains:
| Target | Execution trigger | Reliability |
|---|---|---|
| ~/.bashrc | Next terminal open | High |
| ~/.profile | Next login | High |
| ~/.ssh/rc | Next SSH connection (requires sshd) | High |
| ~/.ssh/authorized_keys | Attacker logs in with command= | Medium |
Reproduction:
Link to reproduction script: path_traversal_poc.zip
docker build -t asyncssh-scp-traversal -f Dockerfile .
docker run --rm asyncssh-scp-traversal
The attached poc_scp_traversal.py starts a malicious SSH server in-process using asyncssh's own API, then downloads from it via asyncssh.scp().
Expected Output:
<img width="1400" height="815" alt="image" src="https://github.com/user-attachments/assets/496745e4-d11d-4ed8-bddd-d15dd13d1751" />
- Record
GHSA-2wxc-x7rj-hg8f- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVPYSEC-2026-3808
8.1
asyncssh has SCP Path Traversal to Arbitrary File Write
| | | |---|---| | Product | asyncssh (all versions through 2.23.0) | | Related | CVE-2019-6111 (same class in OpenSSH) | | Fix | AsyncSSH 2.23.1 |
A malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences. The SCP receive path does not currently sanitize server-provided filenames. By chaining directory traversals via the D (directory) action, an attacker can escape any target directory and overwrite ~/.bashrc, ~/.ssh/rc, or ~/.ssh/authorized_keys, achieving code execution. This is the same vulnerability class as CVE-2019-6111. The mitigation applied in OpenSSH does not appear to have been adopted in asyncssh.
Steps to exploit:
Step 1 - Normal usage: Application calls await asyncssh.scp((conn, 'file'), '/home/user/downloads/'). This is the standard, documented API.
Step 2 - SCP protocol: asyncssh opens an SSH exec channel, runs scp -f file. The server controls the filename field:
C0644 100 ../pwned.txt\n (simple traversal)
D0755 0 ..\n (traverse up, repeat as needed)
C0644 47 .bashrc\n (write payload)
E\n
Step 3 - _parse_cd_args (scp.py:134-142) returns the filename verbatim:
def _parse_cd_args(args: bytes) -> Tuple[int, int, bytes]:
permissions, size, name = args.split(None, 2)
return int(permissions, 8), int(size), name # no sanitization
The returned name is not passed through basename() and is not checked for .. or / components.
Step 4 - _recv_files (scp.py:706-713) joins the unsanitized name:
new_dstpath = posixpath.join(dstpath, name)
With dstpath=b'/home/user/downloads/subdir' and name=b'../pwned.txt', this resolves to /home/user/downloads/pwned.txt, outside the target.
Step 5 - File write: _recv_file opens the traversed path via self._fs.open(dstpath, 'wb') and writes attacker-controlled content. The resolved path is not checked against the target directory boundary.
Step 6 - RCE chains:
| Target | Execution trigger | Reliability |
|---|---|---|
| ~/.bashrc | Next terminal open | High |
| ~/.profile | Next login | High |
| ~/.ssh/rc | Next SSH connection (requires sshd) | High |
| ~/.ssh/authorized_keys | Attacker logs in with command= | Medium |
Reproduction:
Link to reproduction script: path_traversal_poc.zip
docker build -t asyncssh-scp-traversal -f Dockerfile .
docker run --rm asyncssh-scp-traversal
The attached poc_scp_traversal.py starts a malicious SSH server in-process using asyncssh's own API, then downloads from it via asyncssh.scp().
Expected Output:
<img width="1400" height="815" alt="image" src="https://github.com/user-attachments/assets/496745e4-d11d-4ed8-bddd-d15dd13d1751" />
- Record
PYSEC-2026-3808- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-54591
8.1
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.23.1, a malicious SSH server can write arbitrary files on the asyncssh SCP client's filesystem by sending filenames containing ../ traversal sequences because _parse_cd_args in scp.py returns server-provided names verbatim and _recv_files joins them to the destination path without enforcing the target directory boundary. This issue is fixed in version 2.23.1.
- Record
UBUNTU-CVE-2026-54591- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
asyncsshPyPI |
through 2.23.0 | 2.23.1 |
python-asyncsshDebian:12 |
All versions, plus listed versions 2.10.1-22.10.1-2+deb12u12.10.1-2+deb12u22.15.0-12.16.0-1 Show 12 moreShow less2.17.0-12.17.0-22.18.0-12.19.0-12.20.0-12.21.0-12.21.1-12.22.0-12.22.0-22.23.0-12.24.0-12.24.0-2 |
None known |
python-asyncsshDebian:13 |
All versions, plus listed versions 2.20.0-12.21.0-12.21.1-12.22.0-12.22.0-22.23.0-12.24.0-12.24.0-2 |
None known |
python-asyncsshDebian:14 |
before 2.24.0-1, plus listed versions 2.20.0-12.21.0-12.21.1-12.22.0-12.22.0-22.23.0-1 |
2.24.0-1 |
asyncsshPyPI |
before 2.23.1, plus listed versions 0.8.10.8.20.8.30.8.40.9.0 Show 45 moreShow less0.9.10.9.21.0.01.0.11.1.01.1.11.10.01.10.11.11.01.11.11.12.01.12.11.12.21.13.01.13.11.13.21.13.31.14.01.15.01.15.11.16.01.16.11.17.01.17.11.18.01.2.01.2.11.3.01.3.11.3.21.4.01.4.11.5.01.5.11.5.21.5.31.5.41.5.51.5.61.6.01.6.11.6.21.7.11.7.21.7.3 |
2.23.1 |
python-asyncsshUbuntu:16.04:LTS |
All versions, plus listed versions 1.2.0-11.2.1-11.3.0-1 |
None known |
python-asyncsshUbuntu:Pro:18.04:LTS |
All versions, plus listed versions 1.8.1-21.11.0-21.11.1-11.11.1-1ubuntu0.1~esm11.11.1-1ubuntu0.1~esm2 |
None known |
python-asyncsshUbuntu:20.04:LTS |
All versions, plus listed versions 1.12.2-11.12.2-1ubuntu0.11.12.2-1ubuntu0.2 |
None known |
python-asyncsshUbuntu:Pro:22.04:LTS |
All versions, plus listed versions 2.5.0-12.5.0-1ubuntu0.1~esm12.5.0-1ubuntu0.12.5.0-1ubuntu0.1+esm1 |
None known |
python-asyncsshUbuntu:Pro:24.04:LTS |
All versions, plus listed versions 2.10.1-22.10.1-2ubuntu0.12.10.1-2ubuntu0.1+esm1 |
None known |
python-asyncsshUbuntu:25.10 |
All versions, plus listed versions 2.20.0-1 |
None known |
python-asyncsshUbuntu:26.10 |
All versions, plus listed versions 2.21.1-12.23.0-1 |
None known |
python-asyncsshUbuntu:26.04:LTS |
All versions, plus listed versions 2.20.0-12.21.1-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-54591 is a high vulnerability (CVSS 8.1) in Ronf Asyncssh, published July 8, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.49%, the 42nd percentile. Fixed in asyncssh 2.23.1.
References
github.com/ronf/asyncssh/security/advisories/GHSA-2wxc-x7rj-hg8f
github.com/ronf/asyncssh/commit/d730803b8e4e94c20c7580d90f94d1e05f9f58de
github.com/ronf/asyncssh/releases/tag/v2.23.1
nvd.nist.gov/vuln/detail/CVE-2026-54591
github.com/advisories/GHSA-2wxc-x7rj-hg8f
github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54591.json
Left out here: 40 versions. The JSON record has them.