CVE-2013-4260: Medium severity red hat ansible vulnerability
lib/ansible/playbook/init.py in Ansible 1.2.x before 1.2.3, when playbook does not run due to an error, allows local users to overwrite arbitrary files via a symlink attack on a retry file with a predictable name in /var/tmp/ansible/.
Other sources
lib/ansible/playbook/init.py in Ansible 1.2.x before 1.2.3, when playbook does not run due to an error, allows local users to overwrite arbitrary files via a symlink attack on a retry file with a predictable name in /var/tmp/ansible/.
— MITRE
Since version 1.2 of ansible, failed run ( due to connexion errors, or config error ) are listed into /var/tmp/ansible/$scriptname.yml , with $scriptname being the script name used ( or rather the playbook, in ansible linguo )
There is no verification on the file or directory here, and /var/tmp is world writable.
Worst, due to it using a subdirectory under /var/tmp, some symlink protection may not apply ( not tested ). For example, if i create a directory /var/tmp/ansible with owner misc:users and a symlink to a file of joe, the kernel would permit to follow since the symlink and owner of the directory match. This permit to erase file content among others. I am not sure what kind of specific attack could be made by injecting ip and hostname in a specific file, but I am sure this exist.
Code is on https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/init.py#L480
Upstream was not notified yet AFAIK.
I do have a patch almost ready that do : - verify the permission/owner of directory - create a unique directory derived from username ( so predictable ) with proper permission if doesn't exist
I just need to review and test.
The current code do cope with lack of permission on the directory so even if someone create a directory in advance, this will be handled "gracefully" ( I think a message would be better )
— Red Hat
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2013-4260?
CVE-2013-4260 is considered to be of medium severity due to the potential for local users to overwrite arbitrary files.
How do I fix CVE-2013-4260?
To fix CVE-2013-4260, upgrade Ansible to version 1.2.3 or later.
What causes the vulnerability in CVE-2013-4260?
The vulnerability in CVE-2013-4260 is caused by the handling of playbooks that do not run due to errors, allowing for a symlink attack.
Which versions of Ansible are affected by CVE-2013-4260?
CVE-2013-4260 affects Ansible versions 1.2.0 to 1.2.2.
Is CVE-2013-4260 a remote or local vulnerability?
CVE-2013-4260 is a local vulnerability that can be exploited by local users.