CVE-2018-10875: Ansible Ansible Arbitrary Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-fc4h-467w-46rh
CVSS 7.8
CWE-426
Published
Advisory Summary

CVE-2018-10875 is a HIGH (CVSS 7.8) ansible arbitrary code execution vulnerability (CWE-426: Untrusted Search Path) affecting Ansible libraries in the PyPI ecosystem. The issue involves ansible arbitrary code execution. Remediation is available by upgrading affected packages to version 2.5.6, 2.6.1, 2.4.6.0.

CVE-2018-10875 at a Glance

CVE Identifier CVE-2018-10875
GHSA Identifier GHSA-fc4h-467w-46rh
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-426: Untrusted Search Path
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.1/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-10875

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.5.6
pip install ansible>=2.5.6
ansible fixed: 2.6.1
pip install ansible>=2.6.1
ansible fixed: 2.4.6.0
pip install ansible>=2.4.6.0
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-10875, 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.5.6), 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-426: Untrusted Search Path, where the product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control. 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

A flaw was found in ansible. ansible.cfg is read from the current working directory which can be altered to make it point to a plugin or a module path under the control of an attacker, thus allowing the attacker to execute arbitrary code.

CVE-2018-10875 Affected Ansible Versions

3 component(s)
Fixed Versions:
2.5.62.6.12.4.6.0
Product / Package Ecosystem Affected Versions Fixed Version
ansible
PyPI
≥ 2.5.0a1
< 2.5.6
2.5.6
ansible
PyPI
≥ 2.6.0a1
< 2.6.1
2.6.1
ansible
PyPI
< 2.4.6.0
2.4.6.0

References

NVD — CVE-2018-10875 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-10875
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/issues/42388
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/pull/43583
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/pull/42070
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/ff980afefdbe4ceb828bdb1bb2eef03cf616bf63
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/4cecbe81adbc655d7ab734165d3ac539f8ba5981
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible/commit/f32c42c37aaf7b9db93ea3151b2f42a0c4bd8172
Ansible Security Information SECURITY
https://www.debian.org/security/2019/dsa-4396
Ansible Security Information SECURITY
https://web.archive.org/web/20201130165946/http://www.securitytracker.com/id/1041396
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/2019/09/msg00016.html
Ansible Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-43.yaml
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-10875
access.redhat.com/errata/rhsa-2019:00... WEB
https://access.redhat.com/errata/RHSA-2019:0054
access.redhat.com/errata/rhsa-2018:25... WEB
https://access.redhat.com/errata/RHSA-2018:2585
access.redhat.com/errata/rhsa-2018:23... WEB
https://access.redhat.com/errata/RHSA-2018:2321
access.redhat.com/errata/rhsa-2018:21... WEB
https://access.redhat.com/errata/RHSA-2018:2166
access.redhat.com/errata/rhsa-2018:21... WEB
https://access.redhat.com/errata/RHSA-2018:2152
access.redhat.com/errata/rhsa-2018:21... WEB
https://access.redhat.com/errata/RHSA-2018:2151
access.redhat.com/errata/rhsa-2018:21... WEB
https://access.redhat.com/errata/RHSA-2018:2150
access.redhat.com/errata/rhba-2018:37... WEB
https://access.redhat.com/errata/RHBA-2018:3788
Ansible Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00021.html

Frequently Asked Questions

What is CVE-2018-10875?
CVE-2018-10875 is a security vulnerability in Ansible involving Ansible Arbitrary Code Execution under CWE-426: Untrusted Search Path.
Which Ansible versions are affected?
Affected versions include releases prior to 2.5.6, 2.6.1, 2.4.6.0 across affected packages: ansible.
What version fixes CVE-2018-10875?
Upgrading to 2.5.6, 2.6.1, 2.4.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ansible affected?
Yes, ansible is affected in releases prior to 2.5.6, 2.6.1, 2.4.6.0. Upgrade your dependency to 2.5.6, 2.6.1, 2.4.6.0 or later.
What is the CVSS score of CVE-2018-10875?
CVE-2018-10875 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-10875?
CVE-2018-10875 is classified under CWE-426: Untrusted Search Path (The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control.).
How can I check PyPI dependencies for CVE-2018-10875?
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-fc4h-467w-46rh",
  "modified" : "2024-09-05T00:43:11Z",
  "published" : "2022-05-13T01:07:35Z",
  "aliases" : [ "CVE-2018-10875" ],
  "summary" : "Ansible Arbitrary Code Execution",
  "details" : "A flaw was found in ansible. ansible.cfg is read from the current working directory which can be altered to make it point to a plugin or a module path under the control of an attacker, thus allowing the attacker to execute arbitrary code.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/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" : "0"
      }, {
        "fixed" : "2.4.6.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0a1"
      }, {
        "fixed" : "2.5.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.6.0a1"
      }, {
        "fixed" : "2.6.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-10875"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/issues/42388"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/pull/43583"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/pull/42070"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/ff980afefdbe4ceb828bdb1bb2eef03cf616bf63"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/4cecbe81adbc655d7ab734165d3ac539f8ba5981"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/commit/f32c42c37aaf7b9db93ea3151b2f42a0c4bd8172"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2019/dsa-4396"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20201130165946/http://www.securitytracker.com/id/1041396"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4072-1"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2019/09/msg00016.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-43.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ansible/ansible"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-10875"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2019:0054"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2585"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2321"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2166"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2152"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2151"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2150"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHBA-2018:3788"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2019-04/msg00021.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-426" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-22T22:09:48Z",
    "nvd_published_at" : "2018-07-13T22:29:00Z"
  }
}