CVE-2018-16837 is a high-severity (CVSS 7.8) CWE-214 vulnerability in ansible. A fix is available for ansible — see the affected versions and patch details below.
Ansible Leaks Data Passed to ssh-keygen
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
ansible🐍ansible🐍ansibleReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Ansible "User" module leaks any data which is passed on as a parameter to ssh-keygen. This could lean in undesirable situations such as passphrases credentials passed as a parameter for the ssh-keygen executable. Showing those credentials in clear text form for every user which have access just to the process list.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | ansible | ≥ 2.7.0a1&&< 2.7.1 | 2.7.1pip install --upgrade 'ansible==2.7.1' |
| 🐍PyPI | ansible | ≥ 2.6.0a1&&< 2.6.7 | 2.6.7pip install --upgrade 'ansible==2.6.7' |
| 🐍PyPI | ansible | all versions | 2.5.11pip install --upgrade 'ansible==2.5.11' |
Affected Products
debian linuxdebianansible engineredhatansible towerredhatpackage hubsuseDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for ansible, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update ansible to 2.7.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2018-16837 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This issue affects the version of ansible as shipped with Red Hat Ceph Storage 3, as it contains the vulnerable code which leaks the data when ssh-keygen is invoked with any arguments.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Ansible Engine 2.5 for RHEL 7 | ansible-0:2.5.11-1.el7ae | RHSA-2018:3461 |
| Red Hat Ansible Engine 2.6 for RHEL 7 | ansible-0:2.6.7-1.el7ae | RHSA-2018:3460 |
| Red Hat Ansible Engine 2.7 for RHEL 7 | ansible-0:2.7.1-1.el7ae | RHSA-2018:3463 |
| Red Hat Ansible Engine 2 for RHEL 7 | ansible-0:2.7.1-1.el7ae | RHSA-2018:3462 |
| Red Hat OpenStack Platform 13.0 (Queens) | ansible-0:2.6.11-1.el7ae | RHSA-2019:0564 |
| Red Hat OpenStack Platform 14.0 (Rocky) | ansible-0:2.6.11-1.el7ae | RHSA-2019:0590 |
Frequently Asked Questions
Is CVE-2018-16837 in your dependencies?
Find it across PyPI, including transitive dependencies.