CVE-2018-16859: Ansible Ansible Logs Passwords If PowerShell Vulnerability

MODERATE
Advisory Identifier: GHSA-v735-2pp6-h86r
CVSS 4.4
CWE-532
Published
Advisory Summary

CVE-2018-16859 is a MODERATE (CVSS 4.4) ansible logs passwords if powershell vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Ansible libraries in the PyPI ecosystem. The issue involves ansible logs passwords if powershell scriptblock is enabled. Remediation is available by upgrading affected packages to version 2.7.3, 2.5.12, 2.6.9.

CVE-2018-16859 at a Glance

CVE Identifier CVE-2018-16859
GHSA Identifier GHSA-v735-2pp6-h86r
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Ansible
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.4

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

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

How to Fix CVE-2018-16859

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.3
pip install ansible>=2.7.3
ansible fixed: 2.5.12
pip install ansible>=2.5.12
ansible fixed: 2.6.9
pip install ansible>=2.6.9
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-16859, 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.3), 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-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. 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

Execution of Ansible playbooks on Windows platforms with PowerShell ScriptBlock logging and Module logging enabled can allow for 'become' passwords to appear in EventLogs in plaintext. A local user with administrator privileges on the machine can view these logs and discover the plaintext password. Ansible Engine 2.8 and older are believed to be vulnerable.

CVE-2018-16859 Affected Ansible Versions

3 component(s)
Fixed Versions:
2.7.32.5.122.6.9
Product / Package Ecosystem Affected Versions Fixed Version
ansible
PyPI
≥ 2.7.0a1
< 2.7.3
2.7.3
ansible
PyPI
< 2.5.12
2.5.12
ansible
PyPI
≥ 2.6.0a1
< 2.6.9
2.6.9

References

NVD — CVE-2018-16859 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-16859
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/pull/49142
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/0d746b4198abf84290a093b83cf02b4203d73d9f
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/2f8d3fcf41107efafc14d51ab6e14531ca8f8c87
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/4d748d34f9392aa469da00a85c8e2d5fe6cec52b
access.redhat.com/errata/rhsa-2018:37... WEB
https://access.redhat.com/errata/RHSA-2018:3770
access.redhat.com/errata/rhsa-2018:37... WEB
https://access.redhat.com/errata/RHSA-2018:3771
access.redhat.com/errata/rhsa-2018:37... WEB
https://access.redhat.com/errata/RHSA-2018:3772
access.redhat.com/errata/rhsa-2018:37... WEB
https://access.redhat.com/errata/RHSA-2018:3773
bugzilla.redhat.com/show_bug.cgi WEB
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16859
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/blob/v2.5.13/changelogs/CHANGELOG-v2.5.rst
Ansible Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-60.yaml
Ansible Security Information SECURITY
https://web.archive.org/web/20200227102121/http://www.securityfocus.com/bid/106004
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-16859?
CVE-2018-16859 is a security vulnerability in Ansible involving Ansible Logs Passwords If PowerShell ScriptBlock is Enabled under CWE-532: Insertion of Sensitive Information into Log File.
Which Ansible versions are affected?
Affected versions include releases prior to 2.7.3, 2.5.12, 2.6.9 across affected packages: ansible.
What version fixes CVE-2018-16859?
Upgrading to 2.7.3, 2.5.12, 2.6.9 (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.3, 2.5.12, 2.6.9. Upgrade your dependency to 2.7.3, 2.5.12, 2.6.9 or later.
What is the CVSS score of CVE-2018-16859?
CVE-2018-16859 has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2018-16859?
CVE-2018-16859 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check PyPI dependencies for CVE-2018-16859?
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-v735-2pp6-h86r",
  "modified" : "2024-09-04T19:38:45Z",
  "published" : "2022-05-14T01:14:00Z",
  "aliases" : [ "CVE-2018-16859" ],
  "summary" : "Ansible Logs Passwords If PowerShell ScriptBlock is Enabled",
  "details" : "Execution of Ansible playbooks on Windows platforms with PowerShell ScriptBlock logging and Module logging enabled can allow for 'become' passwords to appear in EventLogs in plaintext. A local user with administrator privileges on the machine can view these logs and discover the plaintext password. Ansible Engine 2.8 and older are believed to be vulnerable.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0a1"
      }, {
        "fixed" : "2.7.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.6.0a1"
      }, {
        "fixed" : "2.6.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-16859"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/pull/49142"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/0d746b4198abf84290a093b83cf02b4203d73d9f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/2f8d3fcf41107efafc14d51ab6e14531ca8f8c87"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/4d748d34f9392aa469da00a85c8e2d5fe6cec52b"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3770"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3771"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3772"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3773"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16859"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ansible/ansible"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/blob/v2.5.13/changelogs/CHANGELOG-v2.5.rst"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-60.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200227102121/http://www.securityfocus.com/bid/106004"
  }, {
    "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-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-22T22:07:45Z",
    "nvd_published_at" : "2018-11-29T18:29:00Z"
  }
}