High severity7.8NVD Advisory· Published Jun 3, 2016· Updated May 6, 2026
CVE-2016-3096
CVE-2016-3096
Description
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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
ansiblePyPI | >= 2.0.0.0, < 2.0.2.0 | 2.0.2.0 |
ansiblePyPI | < 1.9.6.1 | 1.9.6.1 |
Affected products
6cpe:2.3:o:fedoraproject:fedora:24:*:*:*:*:*:*:*+ 2 more
- cpe:2.3:o:fedoraproject:fedora:24:*:*:*:*:*:*:*
- cpe:2.3:o:fedoraproject:fedora:22:*:*:*:*:*:*:*
- cpe:2.3:o:fedoraproject:fedora:23:*:*:*:*:*:*:*
Patches
17c3999a92a1cdo not use a predictable filenames in the LXC plugin
1 file changed · +8 −14
cloud/lxc/lxc_container.py+8 −14 modified@@ -144,7 +144,7 @@ description: - Path the save the archived container. If the path does not exist the archive method will attempt to create it. - default: /tmp + default: null archive_compression: choices: - gzip @@ -557,13 +557,8 @@ def create_script(command): import subprocess import tempfile - # Ensure that the directory /opt exists. - if not path.isdir('/opt'): - os.mkdir('/opt') - - # Create the script. - script_file = path.join('/opt', '.lxc-attach-script') - f = open(script_file, 'wb') + (fd, script_file) = tempfile.mkstemp(prefix='lxc-attach-script') + f = os.fdopen(fd, 'wb') try: f.write(ATTACH_TEMPLATE % {'container_command': command}) f.flush() @@ -573,14 +568,11 @@ def create_script(command): # Ensure the script is executable. os.chmod(script_file, 0700) - # Get temporary directory. - tempdir = tempfile.gettempdir() - # Output log file. - stdout_file = open(path.join(tempdir, 'lxc-attach-script.log'), 'ab') + stdout_file = os.fdopen(tempfile.mkstemp(prefix='lxc-attach-script-log')[0], 'ab') # Error log file. - stderr_file = open(path.join(tempdir, 'lxc-attach-script.err'), 'ab') + stderr_file = os.fdopen(tempfile.mkstemp(prefix='lxc-attach-script-err')[0], 'ab') # Execute the script command. try: @@ -1747,14 +1739,16 @@ def main(): ), archive_path=dict( type='str', - default='/tmp' ), archive_compression=dict( choices=LXC_COMPRESSION_MAP.keys(), default='gzip' ) ), supports_check_mode=False, + required_if = ([ + ('archive', True, ['archive_path']) + ]), ) if not HAS_LXC:
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
19- github.com/ansible/ansible-modules-extras/pull/1941nvdPatchWEB
- github.com/ansible/ansible-modules-extras/pull/1941/commits/8c6fe646ee79f5e55361b885b7efed5bec72d4a4nvdPatch
- github.com/ansible/ansible/blob/v2.0.2.0-1/CHANGELOG.mdnvdPatchWEB
- lists.fedoraproject.org/pipermail/package-announce/2016-April/183103.htmlnvdThird Party AdvisoryWEB
- lists.fedoraproject.org/pipermail/package-announce/2016-April/183132.htmlnvdVendor AdvisoryWEB
- lists.fedoraproject.org/pipermail/package-announce/2016-April/183252.htmlnvdVendor AdvisoryWEB
- lists.fedoraproject.org/pipermail/package-announce/2016-April/183274.htmlnvdVendor AdvisoryWEB
- lists.fedoraproject.org/pipermail/package-announce/2016-May/184175.htmlnvdVendor AdvisoryWEB
- github.com/advisories/GHSA-rh6x-qvg7-rrmjghsaADVISORY
- github.com/ansible/ansible/blob/v1.9.6-1/CHANGELOG.mdnvdThird Party AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2016-3096ghsaADVISORY
- security.gentoo.org/glsa/201607-14nvdThird Party AdvisoryWEB
- bugzilla.redhat.com/show_bug.cginvdIssue TrackingWEB
- github.com/ansible/ansible-modules-extras/commit/7c3999a92a1cd856ff9bc8913a93ff1aee8bffc3ghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2016-1.yamlghsaWEB
- groups.google.com/forum/ghsaWEB
- groups.google.com/forum/ghsaWEB
- groups.google.com/forum/nvdWEB
- groups.google.com/forum/nvdWEB
News mentions
0No linked articles in our index yet.