CVE-2016-3096: Ansible Link Following Vulnerability

HIGH
Advisory Identifier: GHSA-rh6x-qvg7-rrmj
CVSS 7.8
CWE-59
Published
Advisory Summary

CVE-2016-3096 is a HIGH (CVSS 7.8) link following vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Ansible libraries in the PyPI ecosystem. The issue involves link following in ansible. Remediation is available by upgrading affected packages to version 2.0.2.0, 1.9.6.1.

CVE-2016-3096 at a Glance

CVE Identifier CVE-2016-3096
GHSA Identifier GHSA-rh6x-qvg7-rrmj
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
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-2016-3096

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.0.2.0
pip install ansible>=2.0.2.0
ansible fixed: 1.9.6.1
pip install ansible>=1.9.6.1
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-2016-3096, 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.0.2.0), 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-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. 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

The `create_script` function in the `lxc_container` module in Ansible before 1.9.6-1 and 2.x before 2.0.2.0 allows local users to write to arbitrary files or gain privileges via a symlink attack on (1) `/opt/.lxc-attach-script`, (2) the archived container in the `archive_path` directory, or the (3) `lxc-attach-script.log` or (4) `lxc-attach-script.err` files in the temporary directory.

CVE-2016-3096 Affected Ansible Versions

2 component(s)
Fixed Versions:
2.0.2.01.9.6.1
Product / Package Ecosystem Affected Versions Fixed Version
ansible
PyPI
≥ 2.0.0.0
< 2.0.2.0
2.0.2.0
ansible
PyPI
< 1.9.6.1
1.9.6.1

References

NVD — CVE-2016-3096 NVD
https://nvd.nist.gov/vuln/detail/CVE-2016-3096
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible-modules-extras/pull/1941
Security Fix Commit FIX COMMIT
https://github.com/ansible/ansible-modules-extras/commit/7c3999a92a1cd856ff9bc8913a93ff1aee8bffc3
bugzilla.redhat.com/show_bug.cgi WEB
https://bugzilla.redhat.com/show_bug.cgi?id=1322925
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-rh6x-qvg7-rrmj
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/blob/v1.9.6-1/CHANGELOG.md#196-dancing-in-the-street---tbd
Ansible Source Repository REPOSITORY
https://github.com/ansible/ansible/blob/v2.0.2.0-1/CHANGELOG.md#202-over-the-hills-and-far-away
Ansible Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2016-1.yaml
groups.google.com/forum/ WEB
https://groups.google.com/forum/#!topic/ansible-announce/E80HLZilTU0
groups.google.com/forum/ WEB
https://groups.google.com/forum/#!topic/ansible-announce/tqiZbcWxYig
groups.google.com/forum/ WEB
https://groups.google.com/forum/#%21topic/ansible-announce/E80HLZilTU0
groups.google.com/forum/ WEB
https://groups.google.com/forum/#%21topic/ansible-announce/tqiZbcWxYig
Ansible Security Information SECURITY
https://security.gentoo.org/glsa/201607-14
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183103.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183132.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183252.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183274.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2016-May/184175.html

Frequently Asked Questions

What is CVE-2016-3096?
CVE-2016-3096 is a security vulnerability in Ansible involving Link Following in ansible under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which Ansible versions are affected?
Affected versions include releases prior to 2.0.2.0, 1.9.6.1 across affected packages: ansible.
What version fixes CVE-2016-3096?
Upgrading to 2.0.2.0, 1.9.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ansible affected?
Yes, ansible is affected in releases prior to 2.0.2.0, 1.9.6.1. Upgrade your dependency to 2.0.2.0, 1.9.6.1 or later.
What is the CVSS score of CVE-2016-3096?
CVE-2016-3096 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-2016-3096?
CVE-2016-3096 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check PyPI dependencies for CVE-2016-3096?
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-rh6x-qvg7-rrmj",
  "modified" : "2024-09-04T18:55:10Z",
  "published" : "2018-10-10T17:23:45Z",
  "aliases" : [ "CVE-2016-3096" ],
  "summary" : "Link Following in ansible",
  "details" : "The `create_script` function in the `lxc_container` module in Ansible before 1.9.6-1 and 2.x before 2.0.2.0 allows local users to write to arbitrary files or gain privileges via a symlink attack on (1) `/opt/.lxc-attach-script`, (2) the archived container in the `archive_path` directory, or the (3) `lxc-attach-script.log` or (4) `lxc-attach-script.err` files in the temporary directory.",
  "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.0.0.0"
      }, {
        "fixed" : "2.0.2.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.1.0"
    }
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ansible"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.6.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.9.6.0"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-3096"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible-modules-extras/pull/1941"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible-modules-extras/commit/7c3999a92a1cd856ff9bc8913a93ff1aee8bffc3"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1322925"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-rh6x-qvg7-rrmj"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ansible/ansible"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/blob/v1.9.6-1/CHANGELOG.md#196-dancing-in-the-street---tbd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansible/ansible/blob/v2.0.2.0-1/CHANGELOG.md#202-over-the-hills-and-far-away"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2016-1.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!topic/ansible-announce/E80HLZilTU0"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!topic/ansible-announce/tqiZbcWxYig"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#%21topic/ansible-announce/E80HLZilTU0"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#%21topic/ansible-announce/tqiZbcWxYig"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/201607-14"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183103.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183132.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183252.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2016-April/183274.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2016-May/184175.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-59" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:54:53Z",
    "nvd_published_at" : "2016-06-03T14:59:00Z"
  }
}