Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1530678 - clamav-server requires nmap-ncat, security concerns
Summary: clamav-server requires nmap-ncat, security concerns
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: clamav
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-03 16:03 UTC by Dimitris
Modified: 2018-02-06 13:03 UTC (History)
10 users (show)

Fixed In Version: clamav-0.99.2-18.fc27 clamav-0.99.2-18.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-06 13:03:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dimitris 2018-01-03 16:03:23 UTC
Description of problem:

The package clamav-server requires the nmap-ncat package to be installed as well.

This causes a rather large concern on public web servers. Almost all remote exploits and various hack-tools, use 'nc' to bypass web server restrictions and to open direct communication to a remote command and control server (c&c).

For example, the admin may try to mitigate the effects of a remote exploit, by disabling PHP functions like curl, psocket, fsocket, so on and so forth. Unfortunately, all of those protections can be by-passed by executing 'nc' which is part of the nmap-ncat package.

While similar functionality is provided by other tools, they can all be removed safely from the system (like wget and curl).

Unfortunately, nmap-ncat can't be removed because it is a required dependency by clamav-server.

I do not know the how clamav-server uses the nmap-ncat package, maybe they are integrated together to the point that they can't be split.

I would appreciate your comments on this issue.

Thank you.



Version-Release number of selected component (if applicable):

nmap-ncat-6.40-7.el7.x86_64

How reproducible:

n/a

Comment 1 Sergio Basto 2018-01-04 13:45:15 UTC
and what you suggest to do ? 
remove Requires: nc  ? 

from [1] 
Unfortunately, netcat (or simply nc) is required to install ClamAV.  I hope they remove that requirement at some point in the future as having netcat on a system just adds another vector of attack.  But, netcat is easily found and installed from the CentOS/RedHat install media or the default repos.

Inspecting clamav-0.99.2+dfsg from Debian , don'thave it as dependency 

I found out that nc is used in unit_tests/check_common.sh 

64:    while nc -z localhost $port 2>/dev/null

[1] 
http://www.yumtechnology.com/2016/11/08/install-clamav-on-centos-7/

Comment 2 Dimitris 2018-01-04 14:11:52 UTC
My personal preference, would be to remove the requirement/dependency to 'nc', if that was possible with a reasonable amount of work.

On a compromised server, if we remove 'nc' then the attacker suddenly looses a major tool of communication, his options become very limited. Because most exploit kits depend on 'nc', if we remove it entirely from the server, then we immediately make those exploit tools obsolete. I think there are very few tools that have alternatives to 'nc' and those usually inject their own tools remotely.

Eventually exploit tools will adapt to this change, but I personally believe it is better to keep ncat away from live/production servers as much as possible.

Comment 3 Jan ONDREJ 2018-01-04 14:35:26 UTC
If netcat is used only in unit_tests and only during compile time, then may be it's better to change Requires: nc to Build-requires: nc.

Comment 4 Fedora Update System 2018-01-05 13:29:26 UTC
clamav-0.99.2-14.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-5c735626b3

Comment 5 Fedora Update System 2018-01-05 16:35:04 UTC
clamav-0.99.2-14.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-84398a7cff

Comment 6 Dimitris 2018-01-05 20:03:49 UTC
wow that was quick, thank you for the quick response!

Comment 7 Fedora Update System 2018-01-06 15:33:11 UTC
clamav-0.99.2-14.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-713df7476e

Comment 8 Fedora Update System 2018-01-06 20:54:11 UTC
clamav-0.99.2-14.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-84398a7cff

Comment 9 Fedora Update System 2018-01-06 21:09:29 UTC
clamav-0.99.2-14.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-5c735626b3

Comment 10 Fedora Update System 2018-01-06 23:30:38 UTC
clamav-0.99.2-14.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-713df7476e

Comment 11 Fedora Update System 2018-01-09 02:22:37 UTC
clamav-0.99.2-15.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-546d6f3abc

Comment 12 Fedora Update System 2018-01-09 17:44:09 UTC
clamav-0.99.2-15.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-546d6f3abc

Comment 13 Fedora Update System 2018-01-10 00:14:20 UTC
clamav-0.99.2-16.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-546d6f3abc

Comment 14 Fedora Update System 2018-01-10 16:13:18 UTC
clamav-0.99.2-16.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-546d6f3abc

Comment 15 Fedora Update System 2018-01-12 02:52:46 UTC
clamav-0.99.2-17.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-e5e5ec6ca2

Comment 16 Fedora Update System 2018-01-12 02:53:10 UTC
clamav-0.99.2-17.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-107dd0492c

Comment 17 Fedora Update System 2018-01-12 02:53:57 UTC
clamav-0.99.2-17.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-1713497ca1

Comment 18 Fedora Update System 2018-01-12 15:13:44 UTC
clamav-0.99.2-17.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-1713497ca1

Comment 19 Fedora Update System 2018-01-12 15:27:53 UTC
clamav-0.99.2-17.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-107dd0492c

Comment 20 Fedora Update System 2018-01-12 15:52:25 UTC
clamav-0.99.2-17.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-e5e5ec6ca2

Comment 21 Fedora Update System 2018-01-17 21:38:07 UTC
clamav-0.99.2-18.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2a1f469c85

Comment 22 Fedora Update System 2018-01-17 21:39:16 UTC
clamav-0.99.2-18.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-a86bad9689

Comment 23 Fedora Update System 2018-01-17 21:39:49 UTC
clamav-0.99.2-18.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-11ba3bced1

Comment 24 Fedora Update System 2018-01-18 00:31:52 UTC
clamav-0.99.2-18.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-11ba3bced1

Comment 25 Fedora Update System 2018-01-18 01:18:23 UTC
clamav-0.99.2-18.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-a86bad9689

Comment 26 Fedora Update System 2018-01-18 02:12:32 UTC
clamav-0.99.2-18.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2a1f469c85

Comment 27 Fedora Update System 2018-01-25 07:15:13 UTC
clamav-0.99.2-18.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 28 Orion Poplawski 2018-01-26 17:02:11 UTC
So the actual dependency comes from the Fedora provided clamav-notify-servers which is run by freshclam-sleep:

/usr/bin/freshclam --quiet && {
    test -x /usr/sbin/clamav-notify-servers &&  \
        exec /usr/sbin/clamav-notify-servers || \
        :

I'm actually not sure the best way to proceed here.  But I'm leaning towards removing clamav-notify-servers.  freshclam.conf can be configured to notify a clamd server, and failing that clamd servers will check periodically for updates - so I don't think we're going to break anything.

Comment 29 Fedora Update System 2018-01-26 17:56:18 UTC
clamav-0.99.2-18.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 30 Sergio Basto 2018-01-26 18:04:58 UTC
clamav-notify-servers [1] is from our sources ... 

[1] 
https://src.fedoraproject.org/rpms/clamav/blob/master/f/clamav-notify-servers

Comment 31 Orion Poplawski 2018-01-26 18:09:52 UTC
yeah, that's what I meant by "Ffedora provided", and why I think it will be okay to remove it.  I'm hoping no one is using it in any custom scripts, although that would be easy to fix by the user.

Comment 32 Sergio Basto 2018-02-06 12:36:05 UTC
OK I see that clamav-notify-servers was removed, so we can close this bug report  as fixed ?

Comment 33 Dimitris 2018-02-06 12:40:14 UTC
Yes please. Thank you for the quick fix. I've managed to remove nmap-ncat from all my servers without any dependency problems.


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