Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 157166 - net-analyzer/fail2ban: remote denial of service (CVE-2006-6302)
Summary: net-analyzer/fail2ban: remote denial of service (CVE-2006-6302)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard: B3 [glsa] jaervosz
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-04 17:00 UTC by Tavis Ormandy (RETIRED)
Modified: 2007-05-10 05:15 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tavis Ormandy (RETIRED) gentoo-dev 2006-12-04 17:00:47 UTC
remote unauthenticated attackers can add arbitrary hosts to the block list of systems using fail2ban.

using something like 
$ ssh "foo from 123.123.123.123"@localhost

As they point out in their faq, local users can also block arbitrary hosts.
Comment 1 Matthias Geerdsen (RETIRED) gentoo-dev 2006-12-05 12:25:35 UTC
tavis, has upstream been notified and is there a fix available?
Comment 2 Cyril Jaquier 2006-12-06 14:53:01 UTC
Hi Tavis and Matthias,

I'm the author of Fail2ban and a Gentoo user too ;)

For 0.6.x, the Debian package contains a fix for this. The problem is that it will break user configuration. I decided not to add this patch for this reason.

For 0.7.x, no releases are normally affected by this issue. If they are, then it is "only" a configuration issue.

Concerning the local exploit, it is not really an issue in Fail2ban. It is not possible to know if the log came from a real daemon or a malicious user. A solution would be to change the permissions on /dev/log.
Comment 3 Cédric Krier gentoo-dev 2006-12-09 12:09:05 UTC
A solution would be to stabilize the 0.7.2 ebuild and then remove the 0.6.x
Comment 4 Marcelo Goes (RETIRED) gentoo-dev 2006-12-09 19:46:21 UTC
I'm with C
Comment 5 Marcelo Goes (RETIRED) gentoo-dev 2006-12-09 19:46:21 UTC
I'm with Cédric.
Comment 6 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-12-10 00:02:13 UTC
Arches please test and mark stable. Target keywords are:

fail2ban-0.7.2.ebuild:KEYWORDS="amd64 hppa x86"
Comment 7 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-12-10 00:02:38 UTC
And now actually with arches CC'ed:-)
Comment 8 Andrej Kacian (RETIRED) gentoo-dev 2006-12-10 01:45:40 UTC
Looks like fail2ban-0.7.2 can't be succesfully restarted:

root@daria /home/ticho # /etc/init.d/fail2ban restart
 * Starting fail2ban ...                                                          [ ok ]
root@daria /home/ticho # /etc/init.d/fail2ban restart
 * Stopping fail2ban ...                                                          [ ok ]
 * Starting fail2ban ...
 * Failed to start fail2ban                                                       [ !! ]
root@daria /home/ticho # /etc/init.d/fail2ban restart
 * Starting fail2ban ...                                                          [ ok ]
root@daria /home/ticho # /etc/init.d/fail2ban restart
 * Stopping fail2ban ...                                                          [ ok ]
 * Starting fail2ban ...
 * Failed to start fail2ban                                                       [ !! ]
root@daria /home/ticho # 
Comment 9 Andrej Kacian (RETIRED) gentoo-dev 2006-12-10 01:48:32 UTC
Tried manually:

root@daria /home/ticho # fail2ban-client start
WARNING No 'maxtime' defined in 'postfix-tcpwrapper'
WARNING No 'maxtime' defined in 'ssh-iptables-report'
WARNING No 'maxtime' defined in 'ssh-tcpwrapper'
WARNING No 'maxtime' defined in 'vsftpd-notification'
WARNING No 'maxtime' defined in 'ssh-iptables'
2006-12-10 10:46:25,969 fail2ban.server : INFO   Starting Fail2ban
root@daria /home/ticho # echo $?
0
root@daria /home/ticho # fail2ban-client stop 
Shutdown successful
root@daria /home/ticho # echo $?
0
root@daria /home/ticho # fail2ban-client start
WARNING No 'maxtime' defined in 'postfix-tcpwrapper'
WARNING No 'maxtime' defined in 'ssh-iptables-report'
WARNING No 'maxtime' defined in 'ssh-tcpwrapper'
WARNING No 'maxtime' defined in 'vsftpd-notification'
WARNING No 'maxtime' defined in 'ssh-iptables'
ERROR  Could not start server. Try -x option
root@daria /home/ticho # 2006-12-10 10:46:38,763 fail2ban.server : INFO   Starting Fail2ban
root@daria /home/ticho # echo $?
255
root@daria /home/ticho # 


The error above was printed immediately, the command returned to shell, and after a moment, the "INFO Starting Fail2ban" message appeared. The "fail2ban-client start" command returned 255, though.

This might be worth looking into.
Comment 10 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-12-10 02:16:18 UTC
Back to ebuild status awaiting a fixed ebuild.
Comment 11 Andrej Kacian (RETIRED) gentoo-dev 2006-12-10 02:17:39 UTC
OK, I have tried 0.7.5, which behaves the same on restart via initscript.

I removed "&> /dev/null" parts from both start() and stop(), and here's what I found out:

root@daria /usr/gentoo/portage/net-analyzer/fail2ban # /etc/init.d/fail2ban restart
 * Starting fail2ban ...
2006-12-10 11:13:55,314 fail2ban.server : INFO   Starting Fail2ban                [ ok ]
root@daria /usr/gentoo/portage/net-analyzer/fail2ban # /etc/init.d/fail2ban restart
 * Stopping fail2ban ...
Shutdown successful                                                               [ ok ]
 * Starting fail2ban ...
ERROR  Server already running
 * Failed to start fail2ban                                                       [ !! ]
root@daria /usr/gentoo/portage/net-analyzer/fail2ban #

Looks like "fail2ban-client stop" is returning too soon, when the server is still running. This is confirmed by manually stopping and starting fail2ban quickly:

root@daria /usr/gentoo/portage/net-analyzer/fail2ban # fail2ban-client stop && fail2ban-client start
Shutdown successful
ERROR  Server already running
root@daria /usr/gentoo/portage/net-analyzer/fail2ban # 
Comment 12 Cyril Jaquier 2006-12-11 15:23:20 UTC
Hi all,

Sorry I should have added myself to CC :(

I have just released 0.6.2 which fixes the issue. Old configuration files will still work but will generate a warning. A named group "host" is now required. This group should match the host address in the log line. Please look at the provided configuration files.

The init script problem has been reported by RedHat users too. Restart need to wait a bit that server shutdowns. I will look into this as soon as possible.

I consider odd version numbers (0.3, 0.5, 0.7) as development releases. Even number (0.4, 0.6, upcoming 0.8) are stable releases. Please, if possible, only stabilize these releases. I will always try to do my best to provide fixes for security issues for these "stable" releases.
Comment 13 Andrej Kacian (RETIRED) gentoo-dev 2006-12-12 07:14:32 UTC
0.6.2 (renamed 0.6.1-r1 ebuild) seems to work.

As this is a security bug, I took the liberty of committing 0.6.2 to the tree, with x86 keyword stable. I hope netmon won't mind. :)

Security, cue archteams! :)
Comment 14 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-12-12 14:01:03 UTC
Thx Andrej, however the 0.6.x series is only safe with the Debian patch according to comment #2.
Comment 15 Andrej Kacian (RETIRED) gentoo-dev 2006-12-12 15:28:58 UTC
(In reply to comment #13)
> Thx Andrej, however the 0.6.x series is only safe with the Debian patch
> according to comment #2.
> 

In comment #11, Cyril says that 0.6.2 has this issue fixed, so I went from there. I can not reproduce the vulnerability with 0.6.2, which bans correct IP, instead of bogus one, as in 0.6.0.
Comment 16 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-12-12 23:12:13 UTC
Woops sorry Andrej.

Arches please test and mark stable. Target keywords are:

fail2ban-0.6.2.ebuild:KEYWORDS="amd64 hppa ~ppc ~ppc64 x86"

Comment 17 Jeroen Roovers (RETIRED) gentoo-dev 2006-12-13 17:46:44 UTC
Stable for HPPA.
Comment 18 Cyril Jaquier 2006-12-17 14:39:13 UTC
Sorry, this is not really the good place to talk about this but as this was reveal in this bug, I post it here.

I (hopefully) fixed the init script for the "restart" issue. Inspired by the squid init script.

https://svn.sourceforge.net/svnroot/fail2ban/trunk/files/gentoo-initd

Could you test it? Is this the right way to do this? Any suggestions?

Thank you
Comment 19 George GTN 2006-12-30 23:14:25 UTC
(In reply to comment #11)
> Hi all,
> 
> Sorry I should have added myself to CC :(
> 
> I have just released 0.6.2 which fixes the issue. Old configuration files will
> still work but will generate a warning. A named group "host" is now required.
> This group should match the host address in the log line. Please look at the
> provided configuration files.
> 
> The init script problem has been reported by RedHat users too. Restart need to
> wait a bit that server shutdowns. I will look into this as soon as possible.
> 
> I consider odd version numbers (0.3, 0.5, 0.7) as development releases. Even
> number (0.4, 0.6, upcoming 0.8) are stable releases. Please, if possible, only
> stabilize these releases. I will always try to do my best to provide fixes for
> security issues for these "stable" releases.
> 


Hallo,

I have emerged the latest in portage fail2ban (0.6.2) with its original configuration file. However, I cannot find the relevant information that has to do with the following error message: 

WARNING: No 'host' group defined. This is a security issue. Please fix your configuration file and look at CVE-2006-6302


I do not clearly understand the way that I can cure this error message. 

From what it is said in this thread I cannot figure out what is the "host address in the log line" that should be matched by the defined 'host' group and how this group can actually be defined. I expected to find some information in the configuration files that I did not manage to spot successfully. 


Kind regards,
orange_juice
Comment 20 Steve Dibb (RETIRED) gentoo-dev 2007-01-23 10:06:29 UTC
amd64 stable
Comment 21 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2007-02-10 20:49:26 UTC
time to glsa-vote.

We issued a GLSA for denyhosts, so i would say Yes here.
Comment 22 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2007-02-12 22:35:55 UTC
i'm actually the only active member of the security team, so i can't apply the policy telling that 2 positive votes include a GLSA. 

Let's have one btw :)
Comment 23 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2007-02-16 00:55:14 UTC
GLSA 200702-05
Comment 24 Fox 2007-05-09 21:37:47 UTC
I have the same problem. Also have no clue what does it mean by host group and how to cure this message.
Comment 25 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-05-10 05:15:17 UTC
@Fox, please open a new bug instead if the problem persists.