Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade asyncssh to version 2.24.2 or higher.
Affected versions of this package are vulnerable to Improper Certificate Validation via the _match_known_hosts function in connection.py when a server uses host-based authentication with known_client_hosts. The vulnerability has two related problems: first, trusted host keys from one host-based authentication attempt accumulate across attempts on the same connection rather than being replaced, allowing a client holding the host key of one known client host to pass the host key check while claiming to be a different known client host; second, X.509 certificates matched in known_client_hosts are appended to the server's global trusted certificate list, causing them to be accepted as trust anchors when validating X.509 user certificates for the remainder of the connection. An attacker can exploit the second problem by making a failed host-based authentication attempt with any host key, which promotes host-only CA certificates into the user-authentication trust store, then authenticating with a user certificate issued under those CAs.
Note: Problem 1 requires trust_client_host to be enabled and a custom validate_host_based_user() that uses client_host in its decision. Problem 2 requires X.509 certificates to be listed in known_client_hosts on a server that also accepts X.509 user certificates by subject name.
For problem 1, leave trust_client_host disabled (the default), or do not rely on client_host in validate_host_based_user(). For problem 2, do not list X.509 certificates in known_client_hosts on servers that also accept X.509 user certificates by subject name.
For problem 1, on the server, `known_client_hosts` lists `build1.corp.test` with host key A and `admin-ws.corp.test` with host key B, and `trust_client_host` is set. `validate_host_based_user()` allows user `admin` only when `client_host` is `admin-ws.corp.test`.
A client holding only host key A makes two host-based attempts on one connection:
1. a request naming `build1.corp.test` (it may fail)
2. a request for user `admin` naming `admin-ws.corp.test`, signed with host key A
The second request passes the host key check, the callback is called with `admin-ws.corp.test`, and the login as `admin` is accepted. A single request naming `admin-ws.corp.test` with host key A is rejected. The stock client sends one host name per connection, so the test client was changed to send a different name on its second attempt.
For problem 2, on the server, `known_client_hosts` contains `* <X.509 CA certificate>`, the authorized keys contain `x509v3-sign-rsa subject=CN=admin`, and no other X.509 certificates are trusted. A user certificate for `CN=admin` issued by that CA is rejected on its own, but accepted if the client first makes a host-based attempt with any host key.
Note: The section describes two server-side scenarios using known_client_hosts configuration but states no specific runtime versions, operating system, or non-default configuration beyond what is described in the vulnerability itself.