CVE-2018-16837: Ansible Ansible Leaks Data Passed To Vulnerability

HIGH
Advisory Identifier: GHSA-hwrm-63v2-42g4
CVSS 7.8
CWE-311
Published
Advisory Summary

CVE-2018-16837 is a HIGH (CVSS 7.8) ansible leaks data passed to vulnerability (CWE-311: Missing Encryption of Sensitive Data) affecting Ansible libraries in the PyPI ecosystem. The issue involves ansible leaks data passed to ssh-keygen. Remediation is available by upgrading affected packages to version 2.7.1, 2.6.7, 2.5.11.

CVE-2018-16837 at a Glance

CVE Identifier CVE-2018-16837
GHSA Identifier GHSA-hwrm-63v2-42g4
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-311: Missing Encryption of Sensitive Data
Affected Product Ansible
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2018-16837

To remediate this vulnerability, upgrade all affected Ansible dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ansible fixed: 2.7.1
pip install ansible>=2.7.1
ansible fixed: 2.6.7
pip install ansible>=2.6.7
ansible fixed: 2.5.11
pip install ansible>=2.5.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show ansible

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2018-16837, inspect your installed packages using pip:

pip show ansible

Analyze the terminal output to locate any version of Ansible in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.1), your application is affected.

Note: The pip show ansible command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-311: Missing Encryption of Sensitive Data, where the product does not encrypt sensitive or critical information before storage or transmission. In Ansible, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2018-16837 Affected Ansible Versions

3 component(s)
Fixed Versions:
2.7.12.6.72.5.11
Product / Package Ecosystem Affected Versions Fixed Version
ansible
PyPI
≥ 2.7.0a1
< 2.7.1
2.7.1
ansible
PyPI
≥ 2.6.0a1
< 2.6.7
2.6.7
ansible
PyPI
< 2.5.11
2.5.11

References

NVD — CVE-2018-16837 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-16837
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/pull/47487
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/pull/47486
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/pull/47445
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/pull/47436
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/77928e6c3a2ad878b20312ce5d74d9d7741e0df0
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/b618339c321c387230d3ea523e80ad47af3de5cf
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/f50cc0b8cb399bb7b7c1ad23b94c9404f0cc6d23
Ansible Security Information SECURITY
https://www.debian.org/security/2019/dsa-4396
Ansible Security Information SECURITY
https://web.archive.org/web/20200227105539/http://www.securityfocus.com/bid/105700
usn.ubuntu.com/4072-1 WEB
https://usn.ubuntu.com/4072-1
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2018/11/msg00012.html
Ansible Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-44.yaml
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/blob/c963ef1dfbf73efea5106624eb48b346f01eaefd/changelogs/CHANGELOG-v2.7.rst?plain=1#L138
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible
bugzilla.redhat.com/show_bug.cgi WEB
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16837
Ansible Security Information SECURITY
https://access.redhat.com/security/cve/cve-2018-16837
access.redhat.com/errata/rhsa-2018:35... WEB
https://access.redhat.com/errata/RHSA-2018:3505
access.redhat.com/errata/rhsa-2018:34... WEB
https://access.redhat.com/errata/RHSA-2018:3463
access.redhat.com/errata/rhsa-2018:34... WEB
https://access.redhat.com/errata/RHSA-2018:3462
access.redhat.com/errata/rhsa-2018:34... WEB
https://access.redhat.com/errata/RHSA-2018:3461
access.redhat.com/errata/rhsa-2018:34... WEB
https://access.redhat.com/errata/RHSA-2018:3460
Ansible Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00021.html
Ansible Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00077.html
Ansible Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00020.html

Frequently Asked Questions

What is CVE-2018-16837?
CVE-2018-16837 is a security vulnerability in Ansible involving Ansible Leaks Data Passed to ssh-keygen under CWE-311: Missing Encryption of Sensitive Data.
Which Ansible versions are affected?
Affected versions include releases prior to 2.7.1, 2.6.7, 2.5.11 across affected packages: ansible.
What version fixes CVE-2018-16837?
Upgrading to 2.7.1, 2.6.7, 2.5.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ansible affected?
Yes, ansible is affected in releases prior to 2.7.1, 2.6.7, 2.5.11. Upgrade your dependency to 2.7.1, 2.6.7, 2.5.11 or later.
What is the CVSS score of CVE-2018-16837?
CVE-2018-16837 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-16837?
CVE-2018-16837 is classified under CWE-311: Missing Encryption of Sensitive Data (The product does not encrypt sensitive or critical information before storage or transmission.).
How can I check PyPI dependencies for CVE-2018-16837?
Run the dependency tree command: 'pip show ansible'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hwrm-63v2-42g4",
  "modified" : "2024-09-04T19:27:47Z",
  "published" : "2022-05-13T01:50:27Z",
  "aliases" : [ "CVE-2018-16837" ],
  "summary" : "Ansible Leaks Data Passed to ssh-keygen",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0a1"
      }, {
        "fixed" : "2.7.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.6.0a1"
      }, {
        "fixed" : "2.6.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-16837"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/pull/47487"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/pull/47486"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/pull/47445"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/pull/47436"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/77928e6c3a2ad878b20312ce5d74d9d7741e0df0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/b618339c321c387230d3ea523e80ad47af3de5cf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/f50cc0b8cb399bb7b7c1ad23b94c9404f0cc6d23"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2019/dsa-4396"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200227105539/http://www.securityfocus.com/bid/105700"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4072-1"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2018/11/msg00012.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-44.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/blob/c963ef1dfbf73efea5106624eb48b346f01eaefd/changelogs/CHANGELOG-v2.7.rst?plain=1#L138"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ansible/ansible"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16837"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/cve-2018-16837"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3505"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3463"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3462"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3461"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3460"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00021.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00077.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00020.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-311" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-22T22:09:04Z",
    "nvd_published_at" : "2018-10-23T15:29:00Z"
  }
}