CVE-2026-45309

AsyncSSH `AuthorizedKeysFile %u` path traversal allows attacker-selected authorized keys to authenticate a traversal username

Published Jul 17, 2026 CVSS 4.0 · 8.2 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Ronf
Ronf asyncssh
Vendors & Products Ronf
Ronf asyncssh
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'}

Weaknesses
  • CWE-22

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 21, 2026, 1:55 AM
Reserved
May 11, 2026, 8:14 PM
Status
Analyzed
Published
Jul 17, 2026, 7:17 PM
Modified
Oct 24, 2026, 8:10 PM