CVE-2020-1740: Insecure Temporary File in Ansible

ansible Updated 02 Oct 2025

Summary

07/04/2021
Yes i
Moderate
4.7

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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.17 2.7.17
    pip install --upgrade "ansible==2.7.17"
  • >= 2.8.0a1, < 2.8.11 2.8.11
    pip install --upgrade "ansible==2.8.11"
  • >= 2.9.0a1, < 2.9.7 2.9.7
    pip 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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for ansible.

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.17 2.7.17
    pip install --upgrade "ansible==2.7.17"
  • >= 2.8.0a1, < 2.8.11 2.8.11
    pip install --upgrade "ansible==2.8.11"
  • >= 2.9.0a1, < 2.9.7 2.9.7
    pip 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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback