CVE-2016-8628 Ansible fails to properly sanitize fact variables sent from the Ansible controller

High 7.6 Published Updated

Attackers can execute arbitrary commands on Ansible clients by sending unsanitized fact variables from the controller.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2016-8628?

CVE-2016-8628 is a high-severity command injection vulnerability in Red Hat Ansible, published on 31 Jul 2018. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official description

Ansible before version 2.2.0 fails to properly sanitize fact variables sent from the Ansible controller. An attacker with the ability to create special variables on the controller could execute arbitrary commands on Ansible clients as the user Ansible runs as.

Weakness: CWE-77

Which versions are affected by CVE-2016-8628?

3 open source packages ship an affected version, including ansible. It affects 1 product.

PackageAffectedFixed in
ansible PyPIAll versions2.2.0.0
ansible PyPIAll versions2.2.0.0
ansible PyPIAll versions2.2.0.0
Linux distribution packages (17)
ansible Red Hat:openshift:3.2::el7All versions0:2.2.0.0-1.el7
atomic-openshift-utils Red Hat:openshift:3.2::el7All versions0:3.2.42-1.git.0.6b09be9.el7
openshift-ansible Red Hat:openshift:3.2::el7All versions0:3.2.42-1.git.0.6b09be9.el7
openshift-ansible-docs Red Hat:openshift:3.2::el7All versions0:3.2.42-1.git.0.6b09be9.el7
openshift-ansible-filter-plugins Red Hat:openshift:3.2::el7All versions0:3.2.42-1.git.0.6b09be9.el7
openshift-ansible-lookup-plugins Red Hat:openshift:3.2::el7All versions0:3.2.42-1.git.0.6b09be9.el7
openshift-ansible-playbooks Red Hat:openshift:3.2::el7All versions0:3.2.42-1.git.0.6b09be9.el7
openshift-ansible-roles Red Hat:openshift:3.2::el7All versions0:3.2.42-1.git.0.6b09be9.el7
ansible Red Hat:openshift:3.3::el7All versions0:2.2.0.0-1.el7
atomic-openshift-utils Red Hat:openshift:3.3::el7All versions0:3.3.50-1.git.0.5bdbeaa.el7
openshift-ansible Red Hat:openshift:3.3::el7All versions0:3.3.50-1.git.0.5bdbeaa.el7
openshift-ansible-callback-plugins Red Hat:openshift:3.3::el7All versions0:3.3.50-1.git.0.5bdbeaa.el7
openshift-ansible-docs Red Hat:openshift:3.3::el7All versions0:3.3.50-1.git.0.5bdbeaa.el7
openshift-ansible-filter-plugins Red Hat:openshift:3.3::el7All versions0:3.3.50-1.git.0.5bdbeaa.el7
openshift-ansible-lookup-plugins Red Hat:openshift:3.3::el7All versions0:3.3.50-1.git.0.5bdbeaa.el7
openshift-ansible-playbooks Red Hat:openshift:3.3::el7All versions0:3.3.50-1.git.0.5bdbeaa.el7
openshift-ansible-roles Red Hat:openshift:3.3::el7All versions0:3.3.50-1.git.0.5bdbeaa.el7

Products include Redhat Ansible.

How do I fix CVE-2016-8628?

Upgrade ansible to 2.2.0.0 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2016-8628 being exploited?

There is no known exploitation of CVE-2016-8628 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2016-8628, GHSA-jg4f-jqm5-4mgq, PYSEC-2018-38, RHSA-2016:2778, UBUNTU-CVE-2016-8628.

Is CVE-2016-8628 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free