Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. asyncssh
  4. ›
  5. CVE-2026-54590

CVE-2026-54590: asyncssh has an incomplete fix for CVE-2026-45309 — AuthorizedKeysFile %u still escapes the intended directory via a leading ~ (and weakly via ${ENV}) username substitution

August 26, 2026

The fix for CVE-2026-45309 added a guard in SSHServerConfig._set_tokens (asyncssh/config.py:715-716) that rejects an SSH username containing /, \, or equal to .., before it is substituted for the %u token in AuthorizedKeysFile:

if self._user == ‘..’ or ‘/’ in self._user or ‘\’ in self._user: raise IllegalUserName(‘Unsafe username substitution’)

However, the %u-substituted value is subsequently passed through environment-variable expansion (_expand_val, config.py:145-149 — token expansion then env expansion) and, at file-open time, through expanduser() (read_authorized_keys → read_file → open(Path(filename).expanduser()), auth_keys.py:348 → misc.py:290). Both re-introduce the path control the guard was meant to remove, so a username that contains no //\ can still cause the server to read an authorized-keys file outside the intended per-user directory.

The client-supplied username reaches this path pre-authentication: _process_userauth_request takes the username from the SSH_MSG_USERAUTH_REQUEST packet (connection.py:2516-2519) and _finish_userauth calls reload_config() (connection.py:2536), which re-evaluates AuthorizedKeysFile with username=self._username (connection.py:5906) before the offered key is validated.

References

  • github.com/advisories/GHSA-qr67-gv47-xwwh
  • github.com/ronf/asyncssh/commit/3d515ba9ba0cd9990d248bdf62bcf05d51261a88
  • github.com/ronf/asyncssh/releases/tag/v2.23.1
  • github.com/ronf/asyncssh/security/advisories/GHSA-qr67-gv47-xwwh
  • nvd.nist.gov/vuln/detail/CVE-2026-54590

Code Behaviors & Features

Detect and mitigate CVE-2026-54590 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.23.1

Fixed versions

  • 2.23.1

Solution

Upgrade to version 2.23.1 or above.

Impact 5.9 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-639: Authorization Bypass Through User-Controlled Key

Source file

pypi/asyncssh/CVE-2026-54590.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 08 Sep 2026 00:16:10 +0000.