Skip to main content

ansible-pylibssh EUVDEUVD-2026-124341

| CVE-2026-126641 MEDIUM
Key Exchange without Entity Authentication (CWE-322)
2026-11-12 redhat GHSA-qvc6-2r95-pxqv
6.5
CVSS 3.1 · Vendor: redhat
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain machine-in-the-middle position on SSH path
  2. Delivery
    Impersonate managed host with changed key
  3. Exploit
    AutoAddPolicy/MyAddPolicy accepts changed key silently
  4. Execution
    Controller authenticates to substitute host
  5. Impact
    Connection credentials disclosed and play executed on rogue host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A04:2025 - Cryptographic Failures
ASVS 5.0
V11 - Cryptography Authenticated key exchange
Exploitation Conditions

Requires trust-on-first-use to be explicitly enabled: host_key_auto_add set on the ansible.netcommon libssh connection plugin, or AutoAddPolicy used in ansible-pylibssh. The targeted host must already be present in known_hosts and must now present a different key (the SSH_KNOWN_HOSTS_CHANGED/SSH_KNOWN_HOSTS_OTHER states), and the attacker must hold an active machine-in-the-middle position on the SSH connection. Exploitation is LIMITED by the fact that default configurations (host_key_checking enabled, host_key_auto_add unset) are not affected, and non-interactive runs fail closed, so only operators who opted into automatic key-adding are exposed.

Impact

This is a medium-severity (CVSS 6.5) trust-on-first-use host key verification weakness whose real-world risk is moderate and conditional rather than urgent. The CVSS vector (AV:N/AC:H/PR:N/UI:N/C:H/I:L/A:N) is internally consistent with the mechanism: network vector because exploitation happens over SSH, PR:N because no credential on the Ansible controller is needed by the attacker, and AC:H because the attacker must achieve a machine-in-the-middle position AND the target host must already exist in known_hosts with a now-changed key. The vuln.today decision label is 'this_month' (not act_now/emergency), and there is no CISA KEV listing, no EPSS score supplied, and no public exploit reference in the input - so there is no public exploit identified at time of analysis and no evidence of active exploitation. These signals align: a real but gated defensive-hardening fix rather than a widespread drive-by threat. The most important limiting factor, stated in the description, is that default configurations (host_key_checking enabled, host_key_auto_add unset) are NOT affected and non-interactive runs fail closed; exploitation requires the non-default trust-on-first-use configuration. Note the absence of EPSS data is a gap, not a signal of low risk; it simply could not be factored in. Overall this is a legitimate credential-exposure issue to patch on a normal cycle, not a high-CVSS-but-illusory finding, but also not an emergency given the config and positioning prerequisites.

Exploit ScenarioDerived

An attacker who can intercept SSH traffic between an Ansible controller (running the libssh connection plugin with host_key_auto_add, or ansible-pylibssh with AutoAddPolicy) and a managed host impersonates that host and presents a different SSH host key. Because the changed-key state is routed to the same policy hook used for unknown hosts, the controller silently accepts the substitute key instead of aborting, authenticates to the attacker, and runs the play there - disclosing connection credentials. No public exploit is identified at time of analysis; the attack requires an active machine-in-the-middle position and a host already present in known_hosts.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 12, 2026

Host key verification in ansible-pylibssh and the ansible.netcommon libssh connection plugin fails to distinguish a changed host key from an unknown one when trust-on-first-use is explicitly enabled, so a machine-in-the-middle attacker presenting a substitute key is accepted without warning and the controller authenticates to the impostor host. Only operators who set host_key_auto_add on the libssh connection plugin or use AutoAddPolicy in ansible-pylibssh are exposed; default configurations with host_key_checking enabled and host_key_auto_add unset are not affected, and non-interactive runs fail closed. Successful exploitation discloses connection credentials and appends the attacker's key to known_hosts, making future connections to that host silently trusted; no public exploit code has been identified at time of analysis and this is a medium-severity (CVSS 6.5) issue whose risk is conditional rather than urgent.

RemediationAI

No vendor-released patch is identified in the available data at time of analysis, so track the Red Hat advisory at https://access.redhat.com/security/cve/CVE-2026-126641 and Bugzilla 2571719 for the fixed package versions and apply them as soon as they are published. In the interim, the complete mitigation is to stop relying on automatic key adoption: leave host_key_auto_add unset on the ansible.netcommon libssh connection plugin and do not use AutoAddPolicy in ansible-pylibssh, keeping host_key_checking enabled so that a changed key aborts the connection rather than being written to known_hosts. Where first-contact automation genuinely requires key discovery, pre-populate known_hosts out of band with keys verified through a separate trusted channel - the trade-off is that adding new hosts becomes a manual provisioning step, and legitimate host key rotations will fail until the record is updated. Restrict playbook execution to non-interactive runs, which fail closed in the affected code path. Audit existing known_hosts files for keys that do not match the expected fingerprints of managed hosts, since a successful attack appends the attacker's key and leaves a durable trust record that must be removed along with any credentials that may have been sent to the substitute host. Do not treat switching to the paramiko connection backend as equivalent unless it has been validated in your environment, since its BadHostKeyException behaviour differs from the vulnerable libssh path.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The flaw sits in the host key verification path shared by ansible-pylibssh and the ansible.netcommon libssh connection plugin, classified as CWE-322 (Key Exchange without Entity Authentication). SSH clients must distinguish three known_hosts outcomes: host unknown, host known with a matching key, and host known with a different key. pylibssh's Session.verify_knownhost() collapses the SSH_KNOWN_HOSTS_CHANGED and SSH_KNOWN_HOSTS_OTHER states into the same missing_host_key() policy hook that is used for genuinely unknown hosts. The bundled AutoAddPolicy and RejectPolicy classes, plus ansible.netcommon's MyAddPolicy (modeled on paramiko's AutoAddPolicy), respond to that hook by adding the presented key and continuing the connection instead of aborting. Paramiko does not behave this way - a changed key raises BadHostKeyException - so users migrating from paramiko-based connections to the libssh backend lose that protection. The result is that the controller completes authentication to the substitute host and writes the attacker's key into known_hosts. The CVSS vector (AV:N/AC:H/PR:N/UI:N) reflects that no credentials are needed to trigger the logic but that the attacker must already hold an active machine-in-the-middle position on the SSH path; the confidentiality impact is high because connection credentials are exposed, with a limited integrity impact from the play executing on the wrong host. Default configurations do not reach this code path, and non-interactive runs fail closed.

Know when Red Hat Ansible Automation Platform 2 gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (redhat) PRIMARY 6.5 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
vuln.today AI 6.5 MEDIUM

AC:H because exploitation needs an MITM position plus a pre-existing changed known_hosts entry under non-default config; PR:N since no controller credential is needed; C:H for credential disclosure, I:L for the rogue play/known_hosts write, A:N.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N
Red Hat 6.5 MEDIUM

Primary rating from Vendor (redhat).

CVSS VectorVendor: redhat

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
None

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.3%
Top 73% exploitable
Prevalence
High
ansible.netcommon libssh is a widely deployed enterprise network-automation collection
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Affected Products (CPE)CVE.org

cpe:2.3:a:red_hat:red_hat_ansible_automation_platform_2:*:*:*:*:*:*:*:*
cpe:2.3:a:red_hat:red_hat_ansible_automation_platform_2:*:*:*:*:*:*:*:*
cpe:2.3:a:red_hat:red_hat_ansible_automation_platform_2:*:*:*:*:*:*:*:*
cpe:2.3:a:red_hat:red_hat_ansible_automation_platform_2:*:*:*:*:*:*:*:*
cpe:2.3:a:red_hat:red_hat_ansible_automation_platform_2:*:*:*:*:*:*:*:*
cpe:2.3:a:red_hat:red_hat_ansible_automation_platform_2:*:*:*:*:*:*:*:*
CVE-2026-84474 CRITICAL
9.9 Sep 23

Privilege escalation and remote code execution on managed hosts is possible in Red Hat Ansible Automation Platform 2 bec

CVE-2026-84502 CRITICAL
9.9 Sep 23

Authenticated users who hold permission to create or modify a project within a single organization can execute arbitrary

CVE-2026-84719 CRITICAL
9.9 Sep 23

Missing authorization checks in the Red Hat Ansible Automation Platform 2 automation-controller allow an authenticated o

CVE-2026-11807 CRITICAL
9.6 Jun 23

Credential disclosure in Red Hat Ansible Automation Platform 2.5 and 2.6 allows any authenticated user to retrieve plain

CVE-2026-12564 CRITICAL
9.6 Aug 18

Server-side request forgery in the Red Hat Ansible Automation Platform 2 Controller's HashiCorp Vault credential plugin

CVE-2026-75884 CRITICAL
9.1 Sep 23

Privilege escalation in Red Hat Ansible Automation Platform 2 (built on the AWX upstream project) lets an authenticated

CVE-2026-12701 CRITICAL
9.0 Jul 20

Arbitrary file write in pulpcore's FilesystemExport feature allows an authenticated administrator to escape the intended

CVE-2026-89091 HIGH
8.8 Oct 08

Symlink-following file overwrite on the Ansible control node is possible in ansible-core when a user runs `ansible-galax

CVE-2026-84683 HIGH
8.7 Sep 23

Stored cross-site scripting in the automation-controller component of Red Hat Ansible Automation Platform 2 lets an auth

CVE-2026-84691 HIGH
8.7 Sep 23

An authenticated automation-controller administrator in Red Hat Ansible Automation Platform 2 can turn the administrator

CVE-2026-92982 HIGH
8.5 Oct 15

Jinja2 template injection in Ansible Operator Plugins (CWE-1336) lets an authenticated Kubernetes user who can create or

CVE-2026-76648 HIGH
8.5 Sep 23

Missing object-level authorization in the JobTemplate copy endpoint (CopyAPIView) of AWX and Red Hat Ansible Automation

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy