CVE-2026-126641
published medium CVSS 3.1 · 6.5Ansible-pylibssh: accepts a changed ssh host key when host_key_auto_add is enabled
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Red Hat | — | ansible-automation-platform-26/ee-supported-rhel9Red Hat Ansible Automation Platform 2 | Affected | Not stated | redhat |
| Red Hat | — | ansible-automation-platform-27/ee-supported-rhel9Red Hat Ansible Automation Platform 2 | Affected | Not stated | redhat |
| Red Hat | — | python3.11-ansible-pylibsshRed Hat Ansible Automation Platform 2 | Affected | Not stated | redhat |
| Red Hat | — | python3.12-ansible-pylibsshRed Hat Ansible Automation Platform 2 | Affected | Not stated | redhat |
| Amazon Linux | AL2023 | Release evaluation | Pending Fix; Not Affected | Not stated | Amazon Linux assessment |
| Red Hat | — | python3x-ansible-pylibsshRed Hat Ansible Automation Platform 2 | Affected | Not stated | redhat |
| Red Hat | — | python-ansible-pylibsshRed Hat Ansible Automation Platform 2 | Affected | Not stated | redhat |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 6.5 / 10
- Severity
- medium
- Provider
- redhat · cna
- Vector string
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Red Hat | Red Hat Ansible Automation Platform 2 | Default: affected | redhat · cna |
| Red Hat | Red Hat Ansible Automation Platform 2 | Default: affected | redhat · cna |
| Red Hat | Red Hat Ansible Automation Platform 2 | Default: affected | redhat · cna |
| Red Hat | Red Hat Ansible Automation Platform 2 | Default: affected | redhat · cna |
| Red Hat | Red Hat Ansible Automation Platform 2 | Default: affected | redhat · cna |
| Red Hat | Red Hat Ansible Automation Platform 2 | Default: affected | redhat · cna |
Weaknesses
1- CWE-322 Key Exchange without Entity Authentication
References
3- http://www.openwall.com/lists/oss-security/2026/11/12/6
- https://access.redhat.com/security/cve/CVE-2026-126641
- RHBZ#2571719 https://bugzilla.redhat.com/show_bug.cgi?id=2571719
Provider assertions
3redhat · cna
Ansible-pylibssh: accepts a changed ssh host key when host_key_auto_add is enabled
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- c96d8814ff53f256939d616b3ee1174a3d4996a8e727ef1a5c76b1064eb4b412
- Ingested
- 13 Nov 2026, 00:37:31 UTC
- Source record
- Official CVE record