CVE-2026-126641Ansible-pylibssh: accepts a changed ssh host key when host_key_auto_add is enabled
- 6.5MediumCVSS base score
- 0.33%Exploitation in 30 daysEPSS · top 73% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
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.
Timeline
ID reserved
By redhat
- 1 day later
· 1 day later
Published
- 1 day later
· 1 day later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| redhatCNA (assigner) | 3.1 | Medium6.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N |
| NVDNVD · Awaiting Analysis | 3.1 | Medium6.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N |
- EPSS (exploitation in 30 days)
- 0.33% · top 73% of all CVEs (16 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: partial
The list uses the assigner's score when there is one, then CISA's, then NVD's: Medium 6.5.
Affected products
Red Hat · Red Hat Ansible Automation Platform 2
All versions: affected
Red Hat · Red Hat Ansible Automation Platform 2
All versions: affected
Red Hat · Red Hat Ansible Automation Platform 2
All versions: affected
Red Hat · Red Hat Ansible Automation Platform 2
All versions: affected
Red Hat · Red Hat Ansible Automation Platform 2
All versions: affected
Red Hat · Red Hat Ansible Automation Platform 2
All versions: affected
What to do
Workaround: Do not enable host_key_auto_add (ansible.netcommon libssh) or AutoAddPolicy (ansible-pylibssh). Keep host_key_checking enabled and pre-populate known_hosts with verified host keys so that a changed key causes the connection to fail closed.
References
References3
- https://access.redhat.com/security/cve/CVE-2026-126641 (opens in a new tab)vdb-entryx_refsource_REDHAT
- RHBZ#2571719 (opens in a new tab)issue-trackingx_refsource_REDHAT
- http://www.openwall.com/lists/oss-security/2026/11/12/6 (opens in a new tab)
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2026-124341 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2026-126641)Record last updated .