Bug 2571719 (CVE-2026-126641) - CVE-2026-126641 ansible-pylibssh: accepts a changed SSH host key when host_key_auto_add is enabled
Summary: CVE-2026-126641 ansible-pylibssh: accepts a changed SSH host key when host_ke...
Keywords:
Status: NEW
Alias: CVE-2026-126641
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2572305 2572306 2572307
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-11-11 14:20 UTC by OSIDB Bzimport
Modified: 2026-11-12 09:30 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-11-11 14:20:07 UTC
When trust-on-first-use is enabled (host_key_auto_add on the libssh plugin, or AutoAddPolicy in pylibssh), a host that is already in known_hosts but now presents a different key is accepted without warning: the controller authenticates to it, runs the play there, and appends the new key to known_hosts. Defaults are not affected - with host_key_checking on and host_key_auto_add unset, non-interactive runs fail closed. Root cause: pylibssh Session.verify_knownhost() passes SSH_KNOWN_HOSTS_CHANGED and SSH_KNOWN_HOSTS_OTHER to the same missing_host_key() policy hook used for unknown hosts. The hook name and the bundled AutoAddPolicy/RejectPolicy classes follow paramiko, where that hook is consulted only for absent hosts and a mismatched key raises BadHostKeyException. ansible.netcommon's MyAddPolicy, documented as "Based on AutoAddPolicy in paramiko", therefore adds changed keys as well. libssh's own tutorial stops the connection on both states. Verified on ansible-pylibssh 1.4.0 / libssh 0.12.0; ansible-core 2.21.5, ansible.netcommon 8.7.1 (ansible 14.5.0); ansible.netcommon.libssh and network_cli with ssh_type=libssh. Reporter: Satriyo Utomo (aleens-labs).


Note You need to log in before you can comment on or make changes to this bug.