Bug 27175 - ansible new security issues CVE-2020-1736, CVE-2020-1433[02], CVE-2020-14365
Summary: ansible new security issues CVE-2020-1736, CVE-2020-1433[02], CVE-2020-14365
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 7
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA7-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2020-08-21 23:50 CEST by David Walser
Modified: 2020-09-05 11:35 CEST (History)
4 users (show)

See Also:
Source RPM: ansible-2.9.11-1.mga8.src.rpm
CVE:
Status comment:


Attachments

Description David Walser 2020-08-21 23:50:44 CEST
Fedora has issued an advisory on August 20:
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/2NYYQP2XJB2TTRP6AKWVMBSPB2DFJNKD/

The issues are fixed upstream in 2.9.12.

Mageia 7 is also affected.
David Walser 2020-08-21 23:50:57 CEST

Whiteboard: (none) => MGA7TOO

Comment 1 Aurelien Oudelet 2020-08-22 17:19:46 CEST
Thanks reporting this,

Assigning to current registered packager.

CC: (none) => ouaurelien
Assignee: bugsquad => bruno.cornec

Comment 2 David Walser 2020-08-22 18:17:42 CEST
Fixed in ansible-2.9.12-1.mga8 in Cauldron by Guillaume.

Whiteboard: MGA7TOO => (none)
CC: (none) => guillomovitch
Version: Cauldron => 7

Comment 3 Bruno Cornec 2020-08-24 11:38:34 CEST
THere is no backport for the 2.7 ansible version we have in mga7. Should I move also to 2.9 there, or should I try to create a backport myself ?

CC: (none) => bruno
Status: NEW => ASSIGNED

Comment 4 David Walser 2020-08-24 14:28:03 CEST
Backport the patches if possible, otherwise we can update it. (2.8.14 probably has the fixes too)
Aurelien Oudelet 2020-08-24 14:28:52 CEST

CC: ouaurelien => (none)

David Walser 2020-08-24 14:30:08 CEST

Component: RPM Packages => Security
QA Contact: (none) => security

Comment 5 Bruno Cornec 2020-08-25 15:02:07 CEST
If I can't backport to the 2.7 I'd prefer to align to 2.9 rather than pushing 2.8.
Working on it today.
Comment 6 Bruno Cornec 2020-08-25 15:10:20 CEST
From https://github.com/ansible/ansible/issues/67794 it seems I'll have to wait a bit (up to 1st of ept it seems)
Comment 7 Bruno Cornec 2020-08-25 15:48:42 CEST
From what I found looking at the issue:

For CVE-14330 the right commit is https://github.com/ansible/ansible/commit/e0f25a2b1f9e6c21f751ba0ed2dc2eee2152983e
For CVE-14332 the right commit is https://github.com/ansible/ansible/pull/71033/commits/c6da98b61948c41a7c171d0ba5cad1d001c3ba0b
For CVE-2020-1736 the bug is still open upstream (https://github.com/ansible/ansible/issues/67794)
Comment 8 Bruno Cornec 2020-08-25 16:02:17 CEST
I've rebuild a version 2.7.18-1.1 with the 2 above patches. I can aloready push that to updates_testing if you think it's useful. Or we can wait till we have a final patch upstream for the last CVE.
Comment 9 David Walser 2020-08-25 16:04:32 CEST
Yeah I think it's ok to wait.  Sounds like they'll have it fixed this week.
Comment 10 David Walser 2020-09-01 23:18:11 CEST
RedHat has issued advisories today (September 1):
https://access.redhat.com/errata/RHSA-2020:3600
https://access.redhat.com/errata/RHSA-2020:3602

The new issue is fixed upstream in 2.8.15 and 2.9.13.

Version: 7 => Cauldron
Whiteboard: (none) => MGA7TOO
Summary: ansible new security issues CVE-2020-1736 and CVE-2020-1433[02] => ansible new security issues CVE-2020-1736, CVE-2020-1433[02], CVE-2020-14365

David Walser 2020-09-01 23:20:59 CEST

Severity: major => critical

Comment 11 Bruno Cornec 2020-09-01 23:57:54 CEST
2.9.13 uploaded to cauldron.
Comment 12 David Walser 2020-09-02 00:16:32 CEST
ansible-2.9.13-1.mga8 uploaded by Bruno, thanks.

I assume they've worked out the issues with CVE-2020-1736 now.

Whiteboard: MGA7TOO => (none)
Version: Cauldron => 7

Comment 13 Bruno Cornec 2020-09-02 00:24:04 CEST
Seems CVE-2020-1736 is still open (bug report is not closed yet)

But I'm unsure whether 2.7 is affected, as the change was related to evolutions during 2.8.

From the last patch:

+* Version 2.8.14 of Ansible changed the default mode of file-based tasks to ``0o600 & ~umask`` when the user did not specify a ``mode`` parameter on file-based tasks. This was in response to a CVE report which we have reconsidered. As a result, the ``mode`` change has been reverted in 2.8.15, and ``mode`` will now default to ``0o666 & ~umask`` as in previous versions of Ansible.
+* If you changed any tasks to specify less restrictive permissions while using 2.8.14, those changes will be unnecessary (but will do no harm) in 2.8.15.
+* To avoid the issue raised in CVE-2020-1736, specify a ``mode`` parameter in all file-based tasks that accept it.

(commit 69827e089415a9d3f9e6b538f8ad64fbb2e079ce)

So I *think* our version is not touched by that. 
Added also the fix for CVE-2020-14365 and pushing to updates_testing
Comment 14 David Walser 2020-09-02 00:26:44 CEST
No, I'm pretty sure 2.7 is affected.  2.8.14 is where they attempted to fix it, but they reverted the fix.
Comment 15 David Walser 2020-09-02 00:29:16 CEST
So we don't have a fix for CVE-2020-1736 right now, but it sounds like not a big deal.  0666 ~ umask is what the OS does anyway, so that should be fine.
Comment 16 David Walser 2020-09-02 00:33:44 CEST
Advisory:
========================

Updated ansible package fixes security vulnerabilities:

An Improper Output Neutralization for Logs flaw was found in Ansible when using
the uri module, where sensitive data is exposed to content and json output.
This flaw allows an attacker to access the logs or outputs of performed tasks
to read keys used in playbooks from other users within the uri module. The
highest threat from this vulnerability is to data confidentiality
(CVE-2020-14430).

A flaw was found in the Ansible Engine when using module_args. Tasks executed
with check mode (--check-mode) do not properly neutralize sensitive data
exposed in the event data. This flaw allows unauthorized users to read this
data. The highest threat from this vulnerability is to confidentiality
(CVE-2020-14432).

A flaw was found in the Ansible Engine when installing packages using the dnf
module. GPG signatures are ignored during installation even when
disable_gpg_check is set to False, which is the default behavior. This flaw
leads to malicious packages being installed on the system and arbitrary code
executed via package installation scripts. The highest threat from this
vulnerability is to integrity and system availability (CVE-2020-14365).

References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14330
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14332
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14365
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/2NYYQP2XJB2TTRP6AKWVMBSPB2DFJNKD/
https://access.redhat.com/errata/RHSA-2020:3600
========================

Updated packages in core/updates_testing:
========================
ansible-2.7.18-1.1.mga7

from ansible-2.7.18-1.1.mga7.src.rpm

Assignee: bruno.cornec => qa-bugs

Comment 17 Herman Viaene 2020-09-02 15:18:02 CEST
MGA7-64 Plasma on Lenovo B50
No installation issues, draws in some other 18 packages.
Following bug 26349, created a hosts file, but
$ ansible -k -i /tmp/hosts all -m ping
SSH password: 
localhost | FAILED! => {
    "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"
}
192.168.2.5 | FAILED! => {
    "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"
}
192.168.2.1 | FAILED! => {
    "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"
Up to now not in the clear what this sshpass program really is. Missing dependency?

CC: (none) => herman.viaene

Comment 18 David Walser 2020-09-02 15:22:24 CEST
It's not a hard dependency.  It depends on how you use it.  People usually use ssh keys with Ansible.  Otherwise you have to use sshpass so it can provide passwords non-interactively.
Comment 19 Herman Viaene 2020-09-04 13:52:33 CEST
Problem was at the time of my first test, I did not find sshpass. Today when using urpmf I find it,and installed it. Strange to me:it is listed in the update repos, not in the core.
Anyway, still struggling what should go in that hosts file.
I put in it three IP adresses, and one FQDN all four of them with an ansible_user and ansible_password defined.
When using the command
$ ansible -k -i /tmp/hosts all -m ping
I get for the two addresses for this laptop "Connection refused" using the actual user/password I'm logged in with, for my desktop PC I get "Success" for the FQDN and "Connection timed out" for its LAN-IP-address, both having the same ansible_user and ansible_password.

This is mind boggling for me.
Comment 20 David Walser 2020-09-04 13:56:55 CEST
That does sound mind boggling.  I feel silly asking, as I believe Mageia runs sshd and has that open in the firewall by default, but perhaps it's still worth checking that both are the case for the computers it refuses to connect to (also that you can regular ping them, just to rule out any other issues).
Comment 21 Herman Viaene 2020-09-04 15:27:07 CEST
Ping commands all OK. Tried ssh from the command line, and then I got it: if I want to ssh into the laptop itself, it needs to run sshd. Which I never installed on this laptop before since I rre-installed it a few months ago.
Once that is mended and the user and passwords are OK in the hosts file, I get 5 times success. One on 127.0.0.1, and on the LAN-IP-addresses and the FQDN of the laptop and desktop in the LAN.

For future reference:
the hosts file contains lines like
<ident of machine> ansible_user=<usename> ansible_pssword=<password of the user>

and at the CLI:
$ ansible -k -i ~/tmp/hosts all -m ping
SSH password: 
leave that paswword empty.

Finally OK.

Whiteboard: (none) => MGA7-64-OK

David Walser 2020-09-04 15:53:22 CEST

CC: (none) => sysadmin-bugs
Keywords: (none) => validated_update

David Walser 2020-09-04 22:07:39 CEST

Keywords: (none) => advisory

Comment 22 Aurelien Oudelet 2020-09-04 22:10:41 CEST
Thanks David, I was AFAK and you hit the "advisory button" before me.
I shoulda do it as soon as do svn.
Comment 23 Mageia Robot 2020-09-05 11:35:35 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2020-0363.html

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.