First published: Tue Feb 11 2020(Updated: )
A race condition flaw was found in Ansible Engine 2.7.17 and prior, 2.8.9 and prior, 2.9.6 and prior when running a playbook with an unprivileged become user. When Ansible needs to run a module with become user, the temporary directory is created in /var/tmp. This directory is created with "umask 77 && mkdir -p <dir>"; this operation does not fail if the directory already exists and is owned by another user. An attacker could take advantage to gain control of the become user as the target directory can be retrieved by iterating '/proc/<pid>/cmdline'.
Credit: secalert@redhat.com secalert@redhat.com
Affected Software | Affected Version | How to fix |
---|---|---|
redhat/ansible | <0:2.7.17-1.el7ae | 0:2.7.17-1.el7ae |
redhat/ansible | <0:2.8.11-1.el7ae | 0:2.8.11-1.el7ae |
redhat/ansible | <0:2.8.11-1.el8ae | 0:2.8.11-1.el8ae |
redhat/ansible | <0:2.9.7-1.el7ae | 0:2.9.7-1.el7ae |
redhat/ansible | <0:2.9.7-1.el8ae | 0:2.9.7-1.el8ae |
Redhat Ansible | <=2.7.16 | |
Redhat Ansible | >=2.8.0<2.8.8 | |
Redhat Ansible | >=2.9.0<=2.9.5 | |
Redhat Ansible Tower | <=3.3.4 | |
Redhat Ansible Tower | >=3.3.5<=3.4.5 | |
Redhat Ansible Tower | >=3.5.0<=3.5.5 | |
Redhat Ansible Tower | >=3.6.0<=3.6.3 | |
Redhat Cloudforms Management Engine | =5.0 | |
Redhat Openstack | =13 | |
Fedoraproject Fedora | =30 | |
Fedoraproject Fedora | =31 | |
Fedoraproject Fedora | =32 | |
Debian Debian Linux | =8.0 | |
Debian Debian Linux | =10.0 | |
debian/ansible | 2.7.7+dfsg-1+deb10u1 2.7.7+dfsg-1+deb10u2 2.10.7+merged+base+2.10.8+dfsg-1 7.3.0+dfsg-1 7.7.0+dfsg-3 | |
redhat/ansible-engine | <2.7.17 | 2.7.17 |
redhat/ansible-engine | <2.8.11 | 2.8.11 |
redhat/ansible-engine | <2.9.7 | 2.9.7 |
pip/ansible | >=2.9.0a1<2.9.7 | 2.9.7 |
pip/ansible | >=2.8.0a1<2.8.11 | 2.8.11 |
pip/ansible | >=0<2.7.17 | 2.7.17 |
This issue can be mitigated by mounting the proc filesystem with hidepid=2 option (https://www.kernel.org/doc/Documentation/filesystems/proc.txt). This way only the user used by Ansible will be able to perform the attack as users on the system will be able to access only their processes /proc/$PID/ directories. Also note that mounting proc filesystem with hidepid=2 might require re-mounting it on unpatched kernels, due to a kernel bug (see https://unix.stackexchange.com/questions/584054/why-procfs-mount-option-only-working-on-remount), there will be hidepid=3 in the future (https://patchwork.kernel.org/patch/11310217/).
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
(Appears in the following advisories)
CVE-2020-1733 is a race condition vulnerability found in Ansible Engine when running a playbook with an unprivileged become user.
CVE-2020-1733 has a medium severity rating.
Ansible Engine 2.7.17 and prior, 2.8.9 and prior, and 2.9.6 and prior are affected by CVE-2020-1733.
To fix CVE-2020-1733, update Ansible Engine to versions 2.7.17, 2.8.11, or 2.9.7.
You can find more information about CVE-2020-1733 on the Red Hat Bugzilla and GitHub pages.