First published: Sun Aug 18 2013(Updated: )
Since version 1.2 of ansible, failed run ( due to connexion errors, or config error ) are listed into /var/tmp/ansible/$script_name.yml , with $script_name 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 <a href="https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/__init__.py#L480">https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/__init__.py#L480</a> 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 )
Affected Software | Affected Version | How to fix |
---|---|---|
Ansible | >=1.2 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
The severity of REDHAT-BUG-998227 is moderate due to potential information leakage.
To fix REDHAT-BUG-998227, ensure proper permissions and verification checks are implemented for the logs generated in /var/tmp.
Ansible versions from 1.2 onwards are affected by REDHAT-BUG-998227.
REDHAT-BUG-998227 can lead to unauthorized access to sensitive log files and potential data exposure.
A possible workaround for REDHAT-BUG-998227 is to manually monitor and secure the /var/tmp directory.