CVE-2020-1740: Insecure Temporary File in Ansible
Summary
CVE-2020-1740: Exposure of Sensitive Information to an Unauthorized Actor and Insecure Temporary File in Ansible. Affects ansible across 3 version ranges.
< 2.7.17
>= 2.8.0a1, < 2.8.11
>= 2.9.0a1, < 2.9.7
Fixed in 2.7.17, 2.8.11 or 2.9.7, depending on the release line you run. How to fix ↓
Also tracked for
- ansible · Alpine:v3.10
The same CVE-2020-1740 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Ansible is an open-source automation tool that allows users to automate IT tasks such as configuration management, application deployment, and orchestration. It is widely used in the industry due to its simplicity and flexibility. However, a vulnerability has been discovered in Ansible Engine that exposes sensitive information to unauthorized actors. This vulnerability affects all versions in the 2.7.x, 2.8.x, and 2.9.x branches.
Vulnerability Detail
The vulnerability arises when using Ansible Vault for editing encrypted files. When a user executes the 'ansible-vault edit' command, another user on the same computer can read both the old and new secrets. This occurs because the secrets are stored in a temporary file created with mkstemp, but the file is insecurely recreated after being closed. The 'write_data' method, responsible for writing the existing secret to the file, deletes the file before recreating it, leaving it vulnerable to unauthorized access. This flaw can lead to the exposure of sensitive information to malicious actors.
How To Fix
Latest published version: 14.5.0 as of 22 Oct 2026
pip install --upgrade "ansible==14.5.0"
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 2.7.172.7.17pip install --upgrade "ansible==2.7.17" -
>= 2.8.0a1, < 2.8.112.8.11pip install --upgrade "ansible==2.8.11" -
>= 2.9.0a1, < 2.9.72.9.7pip install --upgrade "ansible==2.9.7"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, users can avoid using the 'ansible-vault edit' command on systems where multiple users have access. Instead, it is recommended to manually edit the encrypted files using a secure text editor, ensuring that the secrets are not exposed to unauthorized actors.
Conclusion
In conclusion, the vulnerability in Ansible Engine allows for the exposure of sensitive information to unauthorized actors. It is crucial to update to the recommended versions to mitigate this risk. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for ansible →
FAQ
Ansible is an open-source automation tool used for configuration management, application deployment, and orchestration.
Ansible Vault is a feature in Ansible that allows users to encrypt sensitive data, such as passwords and API keys, within playbooks and roles.
The vulnerability occurs when using the 'ansible-vault edit' command, which creates an insecure temporary file that can be accessed by unauthorized actors.
The vulnerability can lead to the exposure of sensitive information, such as passwords and API keys, to unauthorized actors.
Yes, all versions in the 2.7.x, 2.8.x, and 2.9.x branches are believed to be vulnerable.
References
Related vulnerabilities
Recent vulnerabilities recorded for ansible.