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 Arbitrary Argument Injection via ProxyCommand token substitution in asyncssh/config.py. When an OpenSSH client config file sets 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. An attacker who controls the host or user name can embed whitespace or quote characters to inject additional arguments into the proxy program. Additionally, in the affected range, ${...} environment variable references inside a substituted name are expanded, allowing the value of local environment variables to be placed into the proxy command's arguments. With the common ProxyCommand ssh -W %h:%p bastion pattern, an injected -o option can cause the local ssh client to execute attacker-chosen commands as the application user.
Validate host and user names from untrusted sources before passing them to AsyncSSH, rejecting whitespace, quotes, $, and a leading -. Alternatively, avoid %h, %n, and %r in ProxyCommand entries that can match such names, or pass an explicit config argument that does not include them.
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`.