Description
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.0, AsyncSSH expands the OpenSSH-compatible AuthorizedKeysFile %u token in asyncssh/config.py, asyncssh/connection.py, asyncssh/auth_keys.py, and asyncssh/misc.py with the raw SSH username during pre-authentication server config reload, allowing a server configured with AuthorizedKeysFile authorized_keys/%u to read an authorized-keys file outside the intended directory when the SSH username contains /, \, or .. path traversal segments and authenticate with an attacker-selected key file. This issue is fixed in version 2.23.0.
Published: 2026-07-17
Score: 8.2 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

AsyncSSH is a Python package that implements an asynchronous client and server for SSHv2 on top of Python asyncio. Prior to version 2.23.0, the library expands the OpenSSH‑compatible AuthorizedKeysFile %u token in several source files—asyncssh/config.py, asyncssh/connection.py, asyncssh/auth_keys.py, and asyncssh/misc.py—with the raw SSH username during a pre‑authentication server configuration reload. When the server’s AuthorizedKeysFile is configured as authorized_keys/%u, an attacker can supply a username containing path‑traversal characters such as /, \\ or .., causing the server to read an authorized‑keys file located outside the intended directory. By selecting the key file that is read, the attacker can authenticate as any username, effectively bypassing the normal authentication flow. This vulnerability is documented as CWE‑22 and was fixed in version 2.23.0.

Affected Systems

The vulnerability affects all installations of the AsyncSSH Python package from versions prior to 2.23.0 when the server’s AuthorizedKeysFile is set to a pattern like authorized_keys/%u. The affected vendor is ronf (AsyncSSH) and the flaw is present across all code paths that expand the %u token during server configuration reloads.

Risk and Exploitability

The CVSS score of 8.2 reflects a high‑severity authentication bypass. An EPSS score of <1% indicates that active exploitation is currently unlikely, and the flaw is not listed in CISA’s KEV catalog. Nonetheless, an attacker who can supply a crafted SSH username during an initial connection could exploit the path traversal to load a malicious authorized‑keys file, leading to full control over the target machine. The vulnerability is remotely exploitable and does not require local privileges on the affected system.

Generated by OpenCVE AI on July 30, 2026 at 23:51 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the AsyncSSH package to version 2.23.0 or newer, which removes the vulnerable token expansion logic.
  • Verify that the server configuration no longer uses the %u placeholder in AuthorizedKeysFile; replace it with a static path or remove the setting if it is not required.
  • If upgrading immediately is not possible, restrict or disable the use of AuthorizedKeysFile that allows dynamic user paths to prevent path traversal, and ensure that only trusted key files are accessible to the service.

Generated by OpenCVE AI on July 30, 2026 at 23:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-g794-3fmp-753h AsyncSSH `AuthorizedKeysFile %u` path traversal allows attacker-selected authorized keys to authenticate a traversal username
History

Tue, 21 Jul 2026 02:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 17 Jul 2026 21:00:00 +0000

Type Values Removed Values Added
First Time appeared Ronf
Ronf asyncssh
Vendors & Products Ronf
Ronf asyncssh

Fri, 17 Jul 2026 19:00:00 +0000

Type Values Removed Values Added
Description 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.0, AsyncSSH expands the OpenSSH-compatible AuthorizedKeysFile %u token in asyncssh/config.py, asyncssh/connection.py, asyncssh/auth_keys.py, and asyncssh/misc.py with the raw SSH username during pre-authentication server config reload, allowing a server configured with AuthorizedKeysFile authorized_keys/%u to read an authorized-keys file outside the intended directory when the SSH username contains /, \, or .. path traversal segments and authenticate with an attacker-selected key file. This issue is fixed in version 2.23.0.
Title AsyncSSH `AuthorizedKeysFile %u` path traversal allows attacker-selected authorized keys to authenticate a traversal username
Weaknesses CWE-22
References
Metrics cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-21T01:55:16.704Z

Reserved: 2026-05-11T20:14:43.203Z

Link: CVE-2026-45309

cve-icon Vulnrichment

Updated: 2026-07-21T01:54:27.742Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T00:00:06Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')