CVE-2020-1740: Ansible Engine Vulnerability in Ansible Vault

ansible Updated 02 Oct 2025

Summary

16/03/2020
Yes i
Moderate
4.7

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

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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

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

Share this vulnerability

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.

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.0, < 2.8.9 2.8.9
    pip install --upgrade "ansible==2.8.9"
  • >= 2.9.0, < 2.9.6 2.9.6
    pip 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 →

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