GHSA-vcg8-98q8-g7mj CVE-2020-1740 PYSEC-2020-12
Exposure of Sensitive Information to an Unauthorized Actor and Insecure Temporary File in Ansible
- Severity
- 0.0 / 10
- Medium · CVSS 4.0
- Exploit chance (EPSS)
- 0.36%
- Chance of exploitation in the next 30 days. Higher than 30.11% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
- CWE-377 Insecure Temporary File
- Fix
2.7.17- Upgrade ansible to this version or later
Description
A flaw was found in Ansible Engine when using Ansible Vault for editing encrypted files. When a user executes "ansible-vault edit", another user on the same computer can read the old and new secret, as it is created in a temporary file with mkstemp and the returned file descriptor is closed and the method write_data is called to write the existing secret in the file. This method will delete the file before recreating it insecurely. All versions in 2.7.x, 2.8.x and 2.9.x branches are believed to be vulnerable.
Affected versions
PyPI
| Package | Vulnerable | Fixed in |
|---|---|---|
| ansible | < 2.7.17 |
2.7.17 |
| ansible | >= 2.8.0a1, < 2.8.11 |
2.8.11 |
| ansible | >= 2.9.0a1, < 2.9.7 |
2.9.7 |
| ansible | < 2.7.17>= 2.8.0, < 2.8.9>= 2.9.0, < 2.9.6 |
2.7.172.8.92.9.6 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
ansible PyPI → 2.7.17
- pip
pip install --upgrade "ansible>=2.7.17"- poetry
poetry add "ansible>=2.7.17"- uv
uv add "ansible>=2.7.17"
Severity breakdown
CVSS 4.0 0.0
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
- Attack vector
- Local
- Attack complexity
- Low
- Attack requirements
- Present
- Privileges required
- Low
- User interaction
- None
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- None
- Availability (vulnerable system)
- None
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
CVSS 3.1 4.7
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N
- Attack vector
- Local
- Attack complexity
- High
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Weakness
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
How to prevent it
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
CWE-377: Insecure Temporary File
Creating and using insecure temporary files can leave application and system data vulnerable to attack.
References
Advisories
Packages
Other links
- github.com/ansible/ansible/issues/67798
- github.com/ansible/ansible/commit/28f9fbdb5e281976e33f443193047068afb97a9b
- github.com/ansible/ansible/commit/2a563514f070a0a8ba64aebf6bce21194be96c73
- github.com/ansible/ansible/commit/685a4b6d3ff72186d2b4ffce73172a5446a71ccc
- github.com/ansible/ansible/commit/ef32a5bf96a89107986375516285253c1380d7ef
- bugzilla.redhat.com/show_bug.cgi
- github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2020-12.yaml
- lists.debian.org/debian-lts-announce/2020/05/msg00005.html
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DKPA4…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MRRYU…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WQVOQ…
- security.gentoo.org/glsa/202006-11
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DKPA4…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WQVOQ…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MRRYU…
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-8ggh-xwr9-3373 Ansible Community General Collection is vulnerable to exposure of sensitive information | Medium | Also affects ansible |
| GHSA-jpvw-p8pr-9g2x Ansible symlink attack vulnerability | Medium | Also affects ansible |
| GHSA-cpx3-93w7-457x Ansible leaks password to logs | High | Also affects ansible |
| GHSA-fh5v-5f35-2rv2 Insertion of Sensitive Information into Log File in ansible | Medium | Also affects ansible |
| GHSA-4r65-35qq-ch8j Ansible discloses sensitive information in traceback error message | Medium | Also affects ansible |
| GHSA-2pfh-q76x-gwvm Improper Input Validation and Command Injection in Ansible | High | Also affects ansible |
| PYSEC-2021-126 A flaw was found in Ansible if an ansible user sets ANSIBLE_ASYNC_DIR to a subdirectory of a world writable directory. | Not rated yet | Also affects ansible |
| GHSA-r6h7-5pq2-j77h Insufficiently random values in Ansible | Medium | Also affects ansible |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor