Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 64133 - mail-filter/spamassassin: spamd is not using timeouts on sockets - Possible DoS
Summary: mail-filter/spamassassin: spamd is not using timeouts on sockets - Possible DoS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Default Configs (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Security
URL: http://bugzilla.spamassassin.org/show...
Whiteboard: [stable] jaervosz
Keywords:
Depends on: 68841
Blocks:
  Show dependency tree
 
Reported: 2004-09-15 07:17 UTC by Lazar Obradovic
Modified: 2006-03-23 19:14 UTC (History)
3 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 Lazar Obradovic 2004-09-15 07:17:46 UTC
This is just a cross-post from SA bugzilla, so you guys could integrate patch as soon as their bug gets into resolved state.

Reproducible: Always
Steps to Reproduce:
1. Start spamd
2. Connect to spamd's tcp port, issue "CHECK SPAMC/1.2\r\nContent-length: 2000\r\n\r\n"
3. Disconnect, and repeat from step 2 
4. All spamd's will be in IO waiting state, queuing up, spoiling system load and wasting memory. 

If steps 2 and 3 are repeated agressivly, it might kill the machine. If --max-clients is defined, spamd will start to refuse new clients. 



Expected Results:  
Define and enforce timeout values on spamd.
Comment 1 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-09-16 00:29:45 UTC
Lazar thanks for the notification. 

However I'm not authorized to view it. So please post any relevant information here.
Comment 2 Thierry Carrez (RETIRED) gentoo-dev 2004-09-22 08:32:03 UTC
I accessed the discussion through :
http://issues.apache.org/eyebrowse/ReadMsg?listName=dev@spamassassin.apache.org&msgNo=11335

There seem to be an unchecked patch for 2.x, final fix targeted for 3.0.1.
Comment 3 Michael Cummings (RETIRED) gentoo-dev 2004-09-22 08:55:50 UTC
Any luck locating the actual patch? Even with an account in the spamassassin bugzie access to the bug is blocked, and the thread talks around it (unless I missed it)
Comment 4 Thierry Carrez (RETIRED) gentoo-dev 2004-09-22 09:18:29 UTC
Michael: no -- they closed the door to get time to issue 3.0.1 before it gets any publicity. Maybe you should contact them to try to get it... or we should just shut up and wait :)
Comment 5 Michael Cummings (RETIRED) gentoo-dev 2004-09-23 03:45:40 UTC
According to the mail thread you posted they're under the impression we already have it ;)

I guess I concur - based on the thread, I've done a scan for IO::Socket timeout calls and come back empty handed, but haven't had much time to look further. I'll keep poking (when I remember to) until we hear something concrete from the SA folks.
Comment 6 Malte S. Stretz 2004-09-27 06:53:59 UTC
Hmmm... I thought a quick workaround went into 3.0.0 but it doesn't seem so. A patch is under construction, the initially suggested (and untested) one is this <http://bugzilla.spamassassin.org/attachment.cgi?id=2346&action=view> one (if you can access it).

But in my eyes this isn't really a DoS-issue, my comment from that bug:
| Marking as security related, targeting at 3.0.1 for now.  
|   
| Would be cool if it could be fixed for 3.0.0 but if the fix is too complex and  
| this is not a regression compared to 2.6x, we should stay with out current  
| release schedule.  This thing might sound grave but it doesn't sound like you  
| can remotely exploit it and if you have direct access to the spamd port, there  
| are other ways to DoS it.  
Comment 7 Thierry Carrez (RETIRED) gentoo-dev 2004-10-01 05:32:08 UTC
I agree on the "hardly DoS" analysis. Decreasing Severity.
Comment 8 Michael Cummings (RETIRED) gentoo-dev 2004-10-26 16:32:40 UTC
bug 68841 - sa 3.0.1 just added
Comment 9 Thierry Carrez (RETIRED) gentoo-dev 2004-10-27 01:07:15 UTC
Lot of obscurity around this bug... I'm not sure 3.0.1 is fixed, and I'm not sure we can upgrade 3.x to stable just for this bug...

So we can either drop this bug telling direct access to spamd means you can DoS it so you have to restrict access, or we can try to see through SA bug 3782 by contacting them.
Comment 10 Michael Cummings (RETIRED) gentoo-dev 2004-10-27 01:45:08 UTC
Malte: Any word on whether 3.0.1 resolves SA Bug 3782?
Comment 11 Thierry Carrez (RETIRED) gentoo-dev 2004-11-03 02:44:07 UTC
According to http://wiki.apache.org/spamassassin/changes301 it isn't fixed. Could someone with access to the SA bug (reporter / Malte ?) confirm ?
Comment 12 Malte S. Stretz 2004-11-03 09:32:05 UTC
I removed the seurity flag from the bug (which got marked as a dup in between anyway) so you can make up your own mind.

My point is still that this is hardly a high risk security flaw (I can tell you at least two simpler ways to DoS a spamd server if you've got access to the port), at least has it been there since spamd was invented.  This doesn't mean it's not a bug, a fix is still being worked on.
Comment 13 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-11-11 08:58:00 UTC
There is a patch upstream to work around the problem though I hardly think this is worth a security bug.
Comment 14 Thierry Carrez (RETIRED) gentoo-dev 2004-11-23 08:04:26 UTC
OK, we should not consider that a vulnerability, it's by design.

We should put a warning somewhere that spamd should not be open on untrusted networks anyway. Switching this to Default Configs.
Comment 15 Thierry Carrez (RETIRED) gentoo-dev 2004-11-24 08:49:30 UTC
Perl/SA team :

Could you please add a warning (where you think it belongs, either as a ebuild warning or on the configuration item listing the interfaces spamd binds on, if any) stating that spamd was not designed to listen to an untrusted network and is vulnerable to DoS and eternal doom if you do use it like this.
Comment 16 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-12-18 02:56:50 UTC
Perl please provide a fix for comment #15.
Comment 17 Michael Cummings (RETIRED) gentoo-dev 2004-12-20 02:15:35 UTC
Notes added to conf and ebuilds.
Comment 18 Thierry Carrez (RETIRED) gentoo-dev 2004-12-20 05:30:04 UTC
Fixed together with 3.0.2 bump.
Now we need stable markings on the 3.0.x series (about time anyway).

mips, please mark ~mips if ok
other arches, please test and mark stable (if stable) spamassassin-3.0.2 :
Target KEYWORDS="x86 ppc sparc ~mips alpha hppa amd64 ia64 ppc64"
Comment 19 Gustavo Zacarias (RETIRED) gentoo-dev 2004-12-20 05:52:48 UTC
Small quiz before bumping 3.x to stable... does spamass-milter work with it already? Because last time i checked it didn't with SA 3.0+
Thanks.
Comment 20 Malte S. Stretz 2004-12-20 06:10:49 UTC
*Please* do not mark anything before 3.0.2 as stable.

FYI:  A fix for the problem this bug is actually about will probably go into 3.0.3.
Comment 21 Markus Rothe (RETIRED) gentoo-dev 2004-12-20 12:18:04 UTC
works pretty good! stable on ppc64.
Comment 22 Jochen Maes (RETIRED) gentoo-dev 2004-12-23 11:51:07 UTC
stable on ppc
Comment 23 Simon Stelling (RETIRED) gentoo-dev 2004-12-23 14:28:32 UTC
stable on amd64
Comment 24 Jeremy Huddleston (RETIRED) gentoo-dev 2004-12-24 19:32:06 UTC
I don't think this should be in stable, I just restarted updated from 3.0.0-r1 to 3.0.2... It chew up 2G of VM and brought my system to a an unusable load of ~30!  This is on amd64...
Comment 25 Jeremy Huddleston (RETIRED) gentoo-dev 2004-12-24 21:42:22 UTC
hmm... looks like it's not related directly to spamassassin as going down to the old version is doing the same thing:

Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/5.8.6/x86_64-linux/DB_File.pm line 271.
Deep recursion on subroutine "DB_File::AUTOLOAD" at /usr/lib/perl5/5.8.6/x86_64-linux/DB_File.pm line 234.

x86 version works fine... I can't really look into this further now, but I will on the 26th if nobody else has.
Comment 26 Malte S. Stretz 2004-12-25 07:39:37 UTC
Jeremy, what you describe is often a symptom of an updated bdb without a recompiled DB_File.  Re-emerge DB_File and everything should be fine.

I added a page in our Wiki, please update <http://wiki.apache.org/spamassassin/DeepRecursionInDbFile> if you can find out anything new.
Comment 27 Jeremy Huddleston (RETIRED) gentoo-dev 2004-12-25 13:58:21 UTC
Yep, that was it.  Thanks Malte.

Could we get this info added to the GLSA comments:
--
It is recommended that you emerge spamassassin with FEATURES=maketest set.  If you experience high load and errors about deep recursion in the DB_File module, cancel the emerge and first update the DB_File module by running:

g-cpan.pl DB_File

See http://wiki.apache.org/spamassassin/DeepRecursionInDbFile for more information
--

Hopefully that will help anyone else that finds that problem when they upgrade.
Comment 28 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-12-25 23:29:53 UTC
Update line should probably read:

emerge --ask --oneshot --verbose DB_File
Comment 29 Jeremy Huddleston (RETIRED) gentoo-dev 2004-12-26 02:18:35 UTC
ah... yes, use that instead... I didn't realize DB_File was actually in portage as a separate package as mine was provided by dev-lang/perl-5.8.6-r1... so yeah, use the emerge rather than g-cpan.pl ;)

stable on x86
Comment 30 Jeremy Huddleston (RETIRED) gentoo-dev 2004-12-26 12:56:30 UTC
stable sparc
Comment 31 Bryan Østergaard (RETIRED) gentoo-dev 2004-12-26 16:42:55 UTC
Stable on alpha.
Comment 32 Guy Martin (RETIRED) gentoo-dev 2004-12-27 06:47:45 UTC
Stable on hppa.
Comment 33 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2004-12-30 11:55:13 UTC
Thx everyone.

ia64 and mips please remember to mark stable.

Jeremy feel free to reopen if you think the DB_File thing should be noted in the ebuild.