December 1, 2026
AsyncSSH trusted root injection flaw in X.509 certificate validation of the Python SSH library

The AsyncSSH trusted root injection flaw is a critical bug in the Python SSHv2 library, rated 9.1 (CVSS v3.1) in GitHub advisory GHSA-fc6g-2vwf-pcv6. A peer can inject its own trusted X.509 root, so a rogue server can impersonate hosts and a client can log in as any user on servers that use an X.509 cert-authority entry. No exploitation has been confirmed, the advisory itself includes a proof-of-concept, and AsyncSSH 2.24.2 fixes the issue.

CVE ID Product Flaw type CVSS Exploitation / KEV Fixed version
Not assigned (GitHub advisory GHSA-fc6g-2vwf-pcv6) AsyncSSH (PyPI asyncssh) Peer-injected trusted root in X.509 chains (CWE-178, CWE-295, CWE-296) 9.1 (CVSS v3.1, vendor) Public PoC, no confirmed exploitation 2.24.2 or later
CVE-2026-138377 (GitHub advisory GHSA-4hgp-7gmx-wvfg) AsyncSSH (PyPI asyncssh) Host-based auth trust carried over between attempts (CWE-295 in CVE record; CWE-287, CWE-668 in vendor advisory) 5.9 (CVSS v3.1, vendor) / 7.6 (CVSS v4.0, VulnCheck) No confirmed exploitation 2.24.2 or later

What is the AsyncSSH trusted root injection flaw?

The AsyncSSH security advisory GHSA-fc6g-2vwf-pcv6 describes a certificate validation bug in X.509 chain handling. It affects only connections that use X.509 certificates, and only when X.509 trusted certificates are configured. The x509v3-* algorithms must also be in use.

The CVSS v3.1 vector describes a network attack with low complexity, no privileges and no user interaction. It rates confidentiality and integrity impact as high. The flaw has two outcomes, depending on which side the attacker plays.

  • Clients: A client that checks host keys against X.509 trust anchors can be connected to a malicious server posing as any host. The advisory says the attacker can then view and alter the session, capture passwords and abuse a forwarded agent.
  • Servers: A server that accepts X.509 client certificates through an X.509 cert-authority entry in authorized keys can be logged into as any user, with no legitimate certificate.

GitHub Security Lab reported the bug as GHSL-2026-235. It was found with the GitHub Security Lab Taskflow Agent as part of Project Glasswing, and GitHub user anticomputer verified it by hand.

Technical details

AsyncSSH should use a peer’s certificates only to build a path to locally trusted certificates. Instead, it merged them into the trusted set. To keep self-signed roots out, it checked that each certificate’s subject and issuer names differ.

That check compared names exactly. OpenSSL, which performs the actual validation, ignores case and extra whitespace. A peer could send a self-signed root whose subject and issuer differ only in letter case. AsyncSSH then treated it as not self-signed, while OpenSSL accepted it as a trusted root.

Is the AsyncSSH flaw being exploited?

No exploitation in the wild has been confirmed. No CVE ID has been assigned, so there is no NVD or CISA KEV entry. The advisory does publish a proof-of-concept that validates a forged chain against a trust store holding only a legitimate CA. It also describes two end-to-end scenarios: server impersonation during key exchange and an authentication bypass for the user “root”.

Affected and fixed versions

Product Branch Affected versions Fixed version
AsyncSSH (GHSA-fc6g-2vwf-pcv6) All 2.24.1 and earlier 2.24.2
AsyncSSH (CVE-2026-138377 / GHSA-4hgp-7gmx-wvfg) 1.13.1 and later 1.13.1 through 2.24.1 2.24.2

The PyPI release page for AsyncSSH 2.24.2 shows it was published on November 27, 2026. The release requires Python 3.10 or later.

How to fix the AsyncSSH trusted root injection flaw

Upgrade the asyncssh package to 2.24.2 or later. The v2.24.2 release on GitHub carries only a version line, so read the AsyncSSH change log for details. It lists fixes to X.509 trust anchors alongside SFTP chroot escape, SCP filename, reverse DNS and X11 cookie fixes.

According to the advisory, AsyncSSH now hands peer certificates to OpenSSL only as untrusted intermediates. It also drops any that OpenSSL considers self-signed. Only locally configured certificates can now act as trusted roots.

The release also changes some defaults. The rsa2048-sha256 key exchange is now disabled by default, and config file and Include parsing now follow OpenSSH. Test these changes before rolling out widely.

If you cannot patch yet

The advisory’s workaround is to stop relying on X.509 certificates for host or client authentication. Use OpenSSH certificates or plain public keys until you can upgrade.

CVE-2026-138377: a second AsyncSSH X.509 trust flaw

Version 2.24.2 also fixes a separate issue in host-based authentication. The vendor advisory GHSA-4hgp-7gmx-wvfg says servers using known_client_hosts kept trust from one attempt for the rest of the connection. Chris Purcell of L3Digital LLC reported it.

The advisory names two problems. First, host keys trusted for one client host stayed trusted in later attempts. This matters only when trust_client_host is set and the application overrides validate_host_based_user() to use client_host. Second, X.509 certificates listed in known_client_hosts became trust anchors for X.509 user certificates.

The second problem needs a server that accepts X.509 user certificates by subject name. The attacker must hold a user certificate issued under a CA trusted only for client hosts. The workaround is not to list X.509 certificates in known_client_hosts on such servers.

The scores differ by source. The vendor rates it Moderate at 5.9 (CVSS v3.1). VulnCheck, which assigned CVE-2026-138377, rates it 7.6 (CVSS v4.0) and maps it to CWE-295. VulnCheck published the CVE-2026-138377 record on November 29, 2026.

How to check if you are affected

Check the installed asyncssh version in each Python environment and container image. Anything at 2.24.1 or earlier is in scope. Next, look at how your code uses X.509.

Clients are exposed to the trusted root injection flaw if they set x509_trusted_certs or x509_trusted_cert_paths, or have an X.509 @cert-authority entry in known_hosts. Servers are exposed if authorized keys contain an X.509 cert-authority entry. Setups that use only OpenSSH keys or OpenSSH certificates are not affected by this flaw.

Why it matters

X.509 support in AsyncSSH is optional and relies on pyOpenSSL, which PyPI lists as an extra. Where teams do use it, the trust anchors decide who is a valid host or user. This bug let the peer choose its own anchor.

Clients that forward an SSH agent face the widest impact. The advisory says a rogue server can capture passwords and abuse a forwarded agent, not only read the session.

This is also the latest in a run of AsyncSSH fixes in 2026. Earlier flaws include CVE-2026-45309, an AuthorizedKeysFile path traversal fixed in 2.23.0, and CVE-2026-54591, an SCP path traversal fixed in 2.23.1. Teams that pinned AsyncSSH earlier this year should move straight to 2.24.2.

GHSA-fc6g-2vwf-pcv6 has no CVE ID yet. Tools that match only on CVE IDs may not flag it until one is assigned, so check versions directly.

Leave a Reply

Your email address will not be published. Required fields are marked *