GHSA-mv8m-v9v6-5f94: Low severity pip/kas vulnerability
Summary
kas persistently disables SSH host key checking for the invoking user when internal SSH key setup is triggered via SSHPRIVATEKEY or SSHPRIVATEKEYFILE and no user-specific SSH configuration file exists so far.
When this path is used, kas creates ~/.ssh/config with a global Host rule containing StrictHostKeyChecking no. This was intended to ease the use of kas in short-lived CI environments that lack a pre-configured set of known hosts. In case a local user had no SSH configuration file so far, this approach weakens SSH host authenticity verification beyond the lifetime and scope of the kas command, increasing the risk of successful man-in-the-middle attacks against future SSH connections made by the same user.
Patches
Such SSH configurations were created since the very first public release. The issue is addressed now by commit <FILLME> which is part of kas version 5.4.
Workarounds
Since kas 2.6.3, a local user's SSH configuration is only written if it didn't exist before. From that version on, the issue can be avoided by creating an own ~/.ssh/config prior to calling kas. If kas was already called, ~/.ssh/config should be inspected and undesired settings created by kas should be removed.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/kasto a version that resolves this vulnerability.Fixed in 5.4 - Upgrade
Upgrade
kasto a version that resolves this vulnerability.Fixed in 5.4 - Configuration
Inspect the invoking user's ~/.ssh/config and remove any undesired settings created by kas; specifically remove any global Host * rule that sets "StrictHostKeyChecking no" (this may have been created when kas internal SSH key setup was triggered via SSH_PRIVATE_KEY or SSH_PRIVATE_KEY_FILE and no user-specific SSH config existed).
OpenSSH client (~/.ssh/config) StrictHostKeyChecking = remove/restore default (do not use "StrictHostKeyChecking no")
Event History
Frequently Asked Questions
Which environments are exposed to this behavior?
The affected path is triggered when kas is invoked with SSH_PRIVATE_KEY or SSH_PRIVATE_KEY_FILE and the invoking user does not already have a ~/.ssh/config file. It can then affect later SSH connections made by that same user, not only the kas invocation.
Which kas versions should be updated?
The behavior existed since the first public release and is addressed in kas version 5.4. Update to version 5.4 to obtain the fix.
What can be done if updating is not immediately possible?
For kas 2.6.3 and later, create a user-specific ~/.ssh/config before invoking kas so that kas does not create one. This avoids the vulnerable configuration-creation path.
How can I check whether a user was affected?
Inspect ~/.ssh/config for a global "Host *" rule containing "StrictHostKeyChecking no", especially for users that invoked kas with SSH_PRIVATE_KEY or SSH_PRIVATE_KEY_FILE. Such a setting weakens host authenticity verification for subsequent SSH connections by that user.