CVE-2016-9587
published 2018-04-24CVE-2016-9587: Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validation in Ansible's handling of data sent from client systems. An attacker with…
PriorityP268high8.1CVSS 3.1
AVNACHPRNUINSUCHIHAH
EXPLOIT
EPSS
17.65%
96.8th percentile
Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validation in Ansible's handling of data sent from client systems. An attacker with control over a client system being managed by Ansible and the ability to send facts back to the Ansible server could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
Affected
10 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| ansible | ansible | < 2.2.1 | 2.2.1 |
| debian | ansible | < ansible 2.2.0.0-3 (bookworm) | ansible 2.2.0.0-3 (bookworm) |
| redhat | ansible | < 2.1.4 | 2.1.4 |
| redhat | ansible | >= 0 < 2.2.0.0-3 | 2.2.0.0-3 |
| redhat | ansible | >= 0 < 2.2.0.0-3 | 2.2.0.0-3 |
| redhat | ansible | >= 0 < 2.2.0.0-3 | 2.2.0.0-3 |
| redhat | ansible | >= 0 < 2.2.0.0-3 | 2.2.0.0-3 |
| redhat | ansible | >= 0 < 2.1.4.0 | 2.1.4.0 |
| redhat | ansible | >= 2.2.0.0 < 2.2.1.0 | 2.2.1.0 |
| redhat | openstack | — | — |
Detection & IOCsextracted from sources · hover to see the quote
command#jinja2:variable_start_string:'[[',variable_end_string:']]',block_start_string:'[%',block_end_string:'%]'
{{}}
[[ansible_host]][[lookup('pipe', '<PAYLOAD>')]]↗
- →Monitor for Ansible facts containing Jinja2 template injection strings, especially those using alternative variable delimiters (e.g., '[[ ]]') set via the '#jinja2:' header directive in fact values. ↗
- →Detect Ansible fact values that begin with '{' or '[' as these trigger safe_eval evaluation, which can be abused to reconstruct Jinja2 templates and achieve code execution. ↗
- →Detect managed hosts sending back '_ansible_verbose_override': 0 in facts, which is used to suppress verbosity on the controller and hide exploitation attempts. ↗
- →Watch for add_host responses from managed nodes that set 'ansible_python_interpreter' or other interpreter facts via host_vars, which can redirect execution to an attacker-controlled binary. ↗
- →Detect Ansible fact keys containing Jinja2 template syntax (e.g., '{{ ... }}'), as dictionary keys are not sanitized and can be used for template injection when the dict is coerced to a string. ↗
- →Flag known conditional strings being registered as facts (e.g., "ansible_os_family == 'Debian'"), as these trigger a special-case evaluation path in Ansible's conditional handling that can execute injected content. ↗
- ·The exploit requires the attacker to already have control over a managed client host and the ability to send crafted facts back to the Ansible controller — it is not a remote unauthenticated attack. ↗
- ·The fix in versions 2.1.4 and 2.2.1 was incomplete; CVE-2017-7466 tracks the remaining bypass, requiring upgrade to Ansible 2.3 for full remediation. ↗
- ·Verbosity suppression via '_ansible_verbose_override' fact means exploitation attempts may not appear in controller logs even at default verbosity settings. ↗
CVSS provenance
nvdv3.18.1HIGHCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv3.06.6MEDIUMCVSS:3.0/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H
nvdv2.09.3CRITICALAV:N/AC:M/Au:N/C:C/I:C/A:C
osv8.1HIGH
vendor_debian8.1HIGH
vendor_redhat8.1HIGH
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
Ansible is vulnerable to an improper input validation in Ansible's handling of data sent from client systems
ghsa·2018-10-10
CVE-2016-9587 [CRITICAL] CWE-20 Ansible is vulnerable to an improper input validation in Ansible's handling of data sent from client systems
Ansible is vulnerable to an improper input validation in Ansible's handling of data sent from client systems
Ansible before versions 2.1.4.0, 2.2.1.0 is vulnerable to an improper input validation in Ansible's handling of data sent from client systems. An attacker with control over a client system being managed by Ansible and the ability to send facts back to the Ansible server could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
OSV
Ansible is vulnerable to an improper input validation in Ansible's handling of data sent from client systems
osv·2018-10-10
CVE-2016-9587 [CRITICAL] Ansible is vulnerable to an improper input validation in Ansible's handling of data sent from client systems
Ansible is vulnerable to an improper input validation in Ansible's handling of data sent from client systems
Ansible before versions 2.1.4.0, 2.2.1.0 is vulnerable to an improper input validation in Ansible's handling of data sent from client systems. An attacker with control over a client system being managed by Ansible and the ability to send facts back to the Ansible server could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
OSV
CVE-2016-9587: Ansible before versions 2
osv·2018-04-24·CVSS 8.1
CVE-2016-9587 [HIGH] CVE-2016-9587: Ansible before versions 2
Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validation in Ansible's handling of data sent from client systems. An attacker with control over a client system being managed by Ansible and the ability to send facts back to the Ansible server could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
Red Hat
ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587)
vendor_redhat·2017-04-11·CVSS 8.1
CVE-2017-7466 [HIGH] CWE-20 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587)
ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587)
Ansible before version 2.3 has an input validation vulnerability in the handling of data sent from client systems. An attacker with control over a client system being managed by Ansible, and the ability to send facts back to the Ansible server, could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
An input validation vulnerability was found in Ansible's handling of data sent from client systems. An attacker with control over a client system being managed by Ansible, and the ability to send facts back to the Ansible server, could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
Package: ansible (Red Hat O
Red Hat
Ansible: Compromised remote hosts can lead to running commands on the Ansible controller
vendor_redhat·2017-01-09·CVSS 8.1
CVE-2016-9587 [HIGH] CWE-20 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller
Ansible: Compromised remote hosts can lead to running commands on the Ansible controller
Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validation in Ansible's handling of data sent from client systems. An attacker with control over a client system being managed by Ansible and the ability to send facts back to the Ansible server could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
An input validation vulnerability was found in Ansible's handling of data sent from client systems. An attacker with control over a client system being managed by Ansible and the ability to send facts back to the Ansible server could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
Pac
Debian
CVE-2016-9587: ansible - Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validati...
vendor_debian·2016·CVSS 8.1
CVE-2016-9587 [HIGH] CVE-2016-9587: ansible - Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validati...
Ansible before versions 2.1.4, 2.2.1 is vulnerable to an improper input validation in Ansible's handling of data sent from client systems. An attacker with control over a client system being managed by Ansible and the ability to send facts back to the Ansible server could use this flaw to execute arbitrary code on the Ansible server using the Ansible server privileges.
Scope: local
bookworm: resolved (fixed in 2.2.0.0-3)
bullseye: resolved (fixed in 2.2.0.0-3)
forky: resolved (fixed in 2.2.0.0-3)
sid: resolved (fixed in 2.2.0.0-3)
trixie: resolved (fixed in 2.2.0.0-3)
No detection rules found.
Bugzilla
CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [epel-all]
bugzilla·2017-04-11·CVSS 8.1
CVE-2017-7466 [HIGH] CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [epel-all]
CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [epel-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora EPEL.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this issue af
Bugzilla
CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [fedora-all]
bugzilla·2017-04-11·CVSS 8.1
CVE-2017-7466 [HIGH] CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [fedora-all]
CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this issue affec
Bugzilla
CVE-2017-7466 ansible1.9: ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [epel-all]
bugzilla·2017-04-11·CVSS 8.1
CVE-2017-7466 [HIGH] CVE-2017-7466 ansible1.9: ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [epel-all]
CVE-2017-7466 ansible1.9: ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [epel-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora EPEL.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: t
Bugzilla
CVE-2017-7466 ansible1.9: ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [fedora-all]
bugzilla·2017-04-11·CVSS 8.1
CVE-2017-7466 [HIGH] CVE-2017-7466 ansible1.9: ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [fedora-all]
CVE-2017-7466 ansible1.9: ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587) [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this
Bugzilla
CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587)
bugzilla·2017-04-05·CVSS 8.1
CVE-2017-7466 [HIGH] CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587)
CVE-2017-7466 ansible: Arbitrary code execution on control node (incomplete fix for CVE-2016-9587)
It was found that code execution is still possible after applying bcceada5d9b78ad77069c78226f8e9b336ff8949 commit to fix CVE-2016-9587. This was fixed in ansible 2.3 by 0d418789a298561fded9bce977d34babc9097079 however it was not backported to previous versions.
Discussion:
Acknowledgments:
Name: Evgeni Golov (Red Hat)
---
notting [12:52 PM]
jimi-c already pushed the fix to 2.2 git. i'd defer to @jmckerr & @thaumos on what we're going to officially release when
and if it also needs thrown on 2.1. 2.3 isn't affected
---
Created ansible1.9 tracking bugs for this issue:
Affects: fedora-all [bug 1441356]
Affects: epel-all [bug 1441358]
---
Created ansible tracking bugs for this issue:
Bugzilla
CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller [fedora-all]
bugzilla·2017-01-11·CVSS 8.1
CVE-2016-9587 [HIGH] CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller [fedora-all]
CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this issue a
Bugzilla
CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller [epel-all]
bugzilla·2017-01-11·CVSS 8.1
CVE-2016-9587 [HIGH] CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller [epel-all]
CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller [epel-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of Fedora EPEL.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this issu
Bugzilla
CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller
bugzilla·2016-12-13·CVSS 8.1
CVE-2016-9587 [HIGH] CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller
CVE-2016-9587 Ansible: Compromised remote hosts can lead to running commands on the Ansible controller
It is reported that a compromised remote hosts can lead to running commands on the Ansible controller.
Discussion:
Verified attack vectors across devel branch/2.2/2.1 and have created private branches to address the issue across these versions. Due to the holidays, we will hold off on disclosing the vulnerability and will release new candidate versions for stable-2.1 and stable-2.2 branches (2.1.4 RC1 and 2.2.1 RC3 respectively) ASAP in early January.
---
I've attached the original reporters research and findings.
---
Created attachment 1234010
Computest's original findings, code and reporting.
---
Ansible 2.2.1 RC3 and 2.1.4 RC1 were released today, which contain fixes for the s
http://rhn.redhat.com/errata/RHSA-2017-0195.htmlhttp://rhn.redhat.com/errata/RHSA-2017-0260.htmlhttp://www.securityfocus.com/bid/95352https://access.redhat.com/errata/RHSA-2017:0448https://access.redhat.com/errata/RHSA-2017:0515https://access.redhat.com/errata/RHSA-2017:1685https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2016-9587https://security.gentoo.org/glsa/201701-77https://www.exploit-db.com/exploits/41013/http://rhn.redhat.com/errata/RHSA-2017-0195.htmlhttp://rhn.redhat.com/errata/RHSA-2017-0260.htmlhttp://www.securityfocus.com/bid/95352https://access.redhat.com/errata/RHSA-2017:0448https://access.redhat.com/errata/RHSA-2017:0515https://access.redhat.com/errata/RHSA-2017:1685https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2016-9587https://security.gentoo.org/glsa/201701-77https://www.exploit-db.com/exploits/41013/
2018-04-24
Published