Exposure of Sensitive System Information to an Unauthorized Control Sphere Affecting asyncssh package, versions [2.7.0,2.24.2)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.36% (23rd percentile)

Do your applications use this vulnerable package?

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 applications
  • Snyk IDSNYK-PYTHON-ASYNCSSH-23050746
  • published30 Nov 2026
  • disclosed29 Nov 2026
  • creditChris Purcell, Liam Dowd

Introduced: 29 Nov 2026

NewCVE-2026-138375  (opens in a new tab)
CWE-497  (opens in a new tab)

How to fix?

Upgrade asyncssh to version 2.24.2 or higher.

Overview

Affected versions of this package are vulnerable to Exposure of Sensitive System Information to an Unauthorized Control Sphere via SSHConfig._expand_val when an OpenSSH client config file contains a ProxyCommand using the %h, %n, or %r tokens. Host and user names passed to connect() are substituted into the command string before it is split into arguments, so a name containing whitespace or quotes can inject additional arguments into the proxy command. In versions 2.20.0 through 2.24.1, ${NAME} environment variable references inside a substituted name are also expanded, allowing process environment variables such as credentials to be placed into the proxy command's arguments and potentially sent to a remote system. The proxy program runs locally as the user running the application before any SSH connection is established.

PoC

Config of the account that runs the application:

    Host *.corp.test
        ProxyCommand prog --target %h --port %p --login %r

Call:

    await asyncssh.connect('x --injected-option=1 y.corp.test', username='deploy')

Arguments received by `prog`:

    --target x --injected-option=1 y.corp.test --port 22 --login deploy

A user name containing a space does the same through `%r`, and a host name such as `x${SECRET}.corp.test` passes the value of the `SECRET` environment variable to `prog`.

CVSS Base Scores

version 4.0
version 3.1