CVE-2020-1740
Ansible Tower vulnerability analysis and mitigation

Overview

CVE-2020-1740 is a security vulnerability discovered in Ansible Engine affecting the Ansible Vault feature. The vulnerability was found when using Ansible Vault for editing encrypted files. When a user executes 'ansible-vault edit', another user on the same computer can read both the old and new secrets, as they are created in a temporary file with mkstemp. The vulnerability affects all versions in Ansible Engine 2.7.x, 2.8.x, and 2.9.x branches, as well as Ansible Tower versions up to 3.4.5, 3.5.5, and 3.6.3 (Red Hat Bug).

Technical details

The vulnerability occurs in the VaultEditor._edit_file_helper() method where a temporary file is created using tempfile.mkstemp(). The issue arises because the returned file descriptor is closed and VaultEditor.write_data() is called to write the existing secret in the file. This method deletes the file before recreating it insecurely, allowing a malicious user to create the file with permissions that grant them access to the file after the unlink (GitHub Issue). The vulnerability has been assigned a CVSS v3.1 base score of 4.7 (Medium) by NIST with vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N (NVD).

Impact

The vulnerability allows local users on the same system to read sensitive information, including both old and new secrets, when another user is editing encrypted files using the ansible-vault edit command. This could lead to unauthorized access to encrypted credentials and sensitive configuration data (Red Hat Bug).

Mitigation and workarounds

The vulnerability was fixed in Ansible Engine versions 2.7.17, 2.8.11, and 2.9.7. Until systems can be updated, the only mitigation is to avoid using the 'edit' option from the ansible-vault command line tool (Red Hat Bug). Various distributions have released security updates, including Debian, Fedora, and Gentoo (Debian LTS, Fedora Update, Gentoo Security).

Additional resources


SourceThis report was generated using AI

Related Ansible Tower vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2021-4112HIGH8.8
  • Ansible TowerAnsible Tower
  • cpe:2.3:a:redhat:ansible_tower
NoYesAug 25, 2022
CVE-2021-3583HIGH7.1
  • Ansible TowerAnsible Tower
  • ansible-doc
NoYesSep 22, 2021
CVE-2020-14327MEDIUM5.5
  • Ansible TowerAnsible Tower
  • cpe:2.3:a:redhat:ansible_tower
NoYesMay 27, 2021
CVE-2020-14329LOW3.3
  • Ansible TowerAnsible Tower
  • cpe:2.3:a:redhat:ansible_tower
NoYesMay 27, 2021
CVE-2020-14328LOW3.3
  • Ansible TowerAnsible Tower
  • cpe:2.3:a:redhat:ansible_tower
NoYesMay 27, 2021

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management