CVE-2016-3096: Ansible Link Following Vulnerability
HIGHCVE-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
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).
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.
pip install ansible>=2.0.2.0
pip install ansible>=1.9.6.1
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
CVE-2016-3096 Affected Ansible Versions
2 component(s)| 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
Frequently Asked Questions
What is CVE-2016-3096?
Which Ansible versions are affected?
What version fixes CVE-2016-3096?
Is ansible affected?
What is the CVSS score of CVE-2016-3096?
What CWE is associated with CVE-2016-3096?
How can I check PyPI dependencies for CVE-2016-3096?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}