CVE-2026-126641 · Package
NO FIX YET
When trust-on-first-use is enabled, the Ansible libssh connection plugin and ansible-pylibssh accept a host whose SSH key has changed from the one in known_hosts, and append the new key. An attacker positioned on the network path can impersonate the managed host and receive the connection credentials.
first public Nov 12, 2026 · 1 source
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Only controllers that use the libssh connection plugin or ansible-pylibssh with trust-on-first-use turned on (host_key_auto_add set, or AutoAddPolicy in use). Default configurations, where host_key_checking is enabled and host_key_auto_add is unset, are not affected, and non-interactive runs fail closed. The sources do not name the fixed versions.
Not affected if default-config, host_key_checking-enabled, non-interactive-run
Who cares ansible, ansible-pylibssh, ansible.netcommon, libssh
host_key_auto_add is enabled for the libssh connection plugin in the Ansible configuration or inventory.AutoAddPolicy is used in any script or plugin in the controller.host_key_checking is still enabled in ansible.cfg.No fix yet, per the sources.
A host key verification flaw was found in ansible-pylibssh and in the ansible.netcommon libssh connection plugin. When trust-on-first-use is enabled (host_key_auto_add on the libssh connection plugin, or AutoAddPolicy in ansible-pylibssh), a host that is already present in known_hosts but now presents a different key is accepted without warning. The pylibssh Session.verify_knownhost() method passes the SSH_KNOWN_HOSTS_CHANGED and SSH_KNOWN_HOSTS_OTHER states to the same missing_host_key() policy hook used for unknown hosts, and the bundled AutoAddPolicy/RejectPolicy classes (as well as ansible.netcommon's MyAddPolicy, which is modeled on paramiko's AutoAddPolicy) therefore add the changed key and continue the connection rather than aborting as paramiko's BadHostKeyException path would. As a result the controller authenticates to the substitute host, runs the play there, and appends the new key to known_hosts, which can disclose connection credentials to an attacker performing a machine-in-the-middle attack. Default configurations (host_key_checking enabled, host_key_auto_add unset) are not affected; non-interactive runs fail closed.
This page as .md · .json · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.