CVE-2020-1740: Ansible Engine Vulnerability in Ansible Vault
Summary
CVE-2020-1740: A flaw was found in Ansible Engine when using Ansible Vault for editing encrypted files. Affects ansible across 3 version ranges.
< 2.7.17
>= 2.8.0, < 2.8.9
>= 2.9.0, < 2.9.6
Fixed in 2.7.17, 2.8.9 or 2.9.6, 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 Engine is an open-source automation platform that allows users to automate tasks such as configuration management, application deployment, and orchestration. It provides a simple and powerful way to automate IT infrastructure. Ansible Vault is a feature of Ansible Engine that allows users to encrypt sensitive data within playbooks or inventory files. This ensures that sensitive information, such as passwords or API keys, is securely stored and transmitted. However, a vulnerability has been discovered in Ansible Vault that could potentially expose encrypted data to unauthorized users.
Vulnerability Detail
The vulnerability in Ansible Vault arises when a user executes the 'ansible-vault edit' command. During this process, a temporary file is created using the 'mkstemp' function. However, the file is not securely handled, as the file descriptor is closed before the existing secret is written to the file. This allows another user on the same computer to read both the old and new secrets. The file is then deleted and recreated insecurely, potentially leaving the sensitive data exposed. This vulnerability affects all versions in the 2.7.x, 2.8.x, and 2.9.x branches of Ansible Engine.
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.0, < 2.8.92.8.9pip install --upgrade "ansible==2.8.9" -
>= 2.9.0, < 2.9.62.9.6pip install --upgrade "ansible==2.9.6"
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 workaround, users can manually encrypt and decrypt sensitive data outside of Ansible Vault. This can be done using other encryption tools or libraries. However, this workaround may not be as convenient or integrated as using Ansible Vault.
Conclusion
The vulnerability in Ansible Vault can potentially expose encrypted data to unauthorized users. It is important for users to upgrade to the fixed versions of Ansible Engine to ensure the security of their sensitive information. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for ansible →
FAQ
Ansible Engine is an open-source automation platform that allows users to automate tasks such as configuration management, application deployment, and orchestration.
Ansible Vault is a feature of Ansible Engine that allows users to encrypt sensitive data within playbooks or inventory files.
The vulnerability occurs when executing the 'ansible-vault edit' command, where a temporary file is created insecurely, allowing unauthorized users to read sensitive data.
This vulnerability affects all versions in the 2.7.x, 2.8.x, and 2.9.x branches of Ansible Engine.
To fix this vulnerability, users should upgrade to the fixed versions of Ansible Engine.
Related vulnerabilities
Recent vulnerabilities recorded for ansible.