NetBSD Problem Report #10397
Received: (qmail 24854 invoked from network); 19 Jun 2000 23:00:04 -0000
Message-Id: <E134APB-0004PI-00@jellycat.office.ivision.co.uk>
Date: Mon, 19 Jun 2000 23:52:33 +0100
From: jasper@pointless.net
Sender: "Jasper Wallace,,," <jasper@jellycat.office.ivision.co.uk>
Reply-To: jasper@pointless.net
To: gnats-bugs@gnats.netbsd.org
Subject: syslogd -s vulnerable to flodding.
X-Send-Pr-Version: 3.95
>Number: 10397
>Category: security
>Synopsis: syslogd -s vulnerable to flooding.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: security-officer
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Jun 19 23:01:01 +0000 2000
>Closed-Date: Sun Oct 08 17:34:50 +0000 2006
>Last-Modified: Sun Oct 08 17:34:50 +0000 2006
>Originator: Jasper Wallace
>Release: port-i386-20000527-snapshot
>Organization:
--
http://pointless.net/ : Another Great waste of bandwidth!
http://advogato.com/ : nothing to do with me, but worth a look.
http://www.ivision.co.uk/ : I pretend to work for these people.
2ECA0975 :: 45 52 65 E9 33 C7 72 4B 96 F4 44 2D 79 27 BF 08
>Environment:
System: NetBSD jellycat 1.4Z NetBSD 1.4Z (JELLYCAT.pnpbios) #4: Wed Jun 7 17:32:23 BST 2000 root@:/usr/src/sys/arch/i386/compile/JELLYCAT.pnpbios i386
>Description:
By flodding syslog (with ' lptest 200 1000000 | ./nc -u <hostname> syslog'
for example) it's possible to make the target machine reach it's mclpool
limit. (nc is netcat - see: pkgsrc/net/netcat ).
over a 2Mb line:
Jun 19 22:18:54 jellycat /netbsd: WARNING: mclpool limit reached; increase NMBCLUSTERS
The machine was still pretty usable, this may of been due to most of the
packets being fragmented and netbsd dropping them due to lack of space (at
least thats what 'netstat -p ip' implys).
Over 10Mb ethernet:
Jun 19 22:48:50 jellycat /netbsd: ne0: warning - receiver ring buffer overrun
Jun 19 22:48:51 jellycat last message repeated 8 times
Jun 19 22:48:51 jellycat /netbsd: WARNING: mclpool limit reached; increase NMBCLUSTERS
Jun 19 22:48:51 jellycat /netbsd: ne0: warning - receiver ring buffer overrun
Jun 19 22:49:20 jellycat last message repeated 350 times
The machine was unusable during this time. (but thats much more the fault of
ne0 than anything else).
>How-To-Repeat:
'lptest 200 1000000 | ./nc -u <hostname> syslog'
see what happens to <hostname>
>Fix:
patch adds -S which does no networking at all.
Also updates man page for -s and -S
--- syslogd.c.netbsd.orig Mon Jun 19 23:15:32 2000
+++ syslogd.c Mon Jun 19 23:36:08 2000
@@ -192,6 +192,7 @@
int MarkInterval = 20 * 60; /* interval between marks in seconds */
int MarkSeq = 0; /* mark sequence number */
int SecureMode = 0; /* when true, speak only unix domain socks */
+int HalfSecureMode; /* when true, don't listen to our socket, send only */
char **LogPaths; /* array of pathnames to read messages from */
void cfline __P((char *, struct filed *));
@@ -227,7 +228,7 @@
char *p, *line, **pp;
struct pollfd *readfds;
- while ((ch = getopt(argc, argv, "dsf:m:p:P:")) != -1)
+ while ((ch = getopt(argc, argv, "dsSf:m:p:P:")) != -1)
switch(ch) {
case 'd': /* debug */
Debug++;
@@ -246,9 +247,12 @@
logpath_fileadd(&LogPaths, &funixsize,
&funixmaxsize, optarg);
break;
- case 's': /* no network mode */
- SecureMode++;
+ case 's': /* don't listen to the network */
+ HalfSecureMode++;
break;
+ case 'S': /* don't do any networking at all */
+ SecureMode++;
+ break;
case '?':
default:
usage();
@@ -319,9 +323,13 @@
dprintf("listening on unix dgram socket %s\n", *pp);
}
- finet = socksetup(PF_UNSPEC);
+ if (!SecureMode)
+ finet = socksetup(PF_UNSPEC);
+ else
+ finet = NULL;
+
if (finet) {
- if (SecureMode) {
+ if (HalfSecureMode) {
for (j = 0; j < *finet; j++) {
if (shutdown(finet[j+1], SHUT_RD) < 0) {
logerror("shutdown");
@@ -361,7 +369,7 @@
readfds[nfklogix].fd = fklog;
readfds[nfklogix].events = POLLIN | POLLPRI;
}
- if (finet && !SecureMode) {
+ if (finet && !HalfSecureMode ) {
nfinetix = malloc(*finet * sizeof(*nfinetix));
for (j = 0; j < *finet; j++) {
nfinetix[j] = nfds++;
@@ -421,7 +429,7 @@
logerror(buf);
}
}
- if (finet && !SecureMode) {
+ if (finet && !HalfSecureMode ) {
for (j = 0; j < *finet; j++) {
if (readfds[nfinetix[j]].revents &
(POLLIN | POLLPRI)) {
@@ -448,7 +456,7 @@
extern char *__progname;
(void)fprintf(stderr,
-"usage: %s [-f conffile] [-m markinterval] [-p logpath1] [-p logpath2 ..]\n",
+"usage: %s -sS [-f conffile] [-m markinterval] [-P file of log paths] [-p logpath1] [-p logpath2 ..]\n",
__progname);
exit(1);
}
--- syslogd.8.netbsd.orig Mon Jun 19 23:20:08 2000
+++ syslogd.8 Mon Jun 19 23:25:18 2000
@@ -74,7 +74,13 @@
Select the number of minutes between ``mark'' messages;
the default is 20 minutes.
.It Fl s
-Select ``secure'' mode, in which syslogd does not open a UDP socket but
+Select ``half secure'' mode, in which syslogd opens a UDP socket but
+only uses it for sending mesages. Attackers will not be able to fill up your
+logs remotly, but, if there is a fast connection between you and them, can
+cause your machine to waste time discarding packets, and fill up kernel
+buffer space.
+.It Fl S
+Select ``secure'' mode , in which syslogd does not open a UDP socket, and
only communicates over a
.Ux
domain socket.
>Release-Note:
>Audit-Trail:
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
To: gnats-bugs@gnats.netbsd.org
Cc:
Subject: Re: security/10397: syslogd -s vulnerable to flooding.
Date: Wed, 5 Jul 2000 08:53:39 -0400 (EDT)
A somewhat better fix has been integrated by jwise into syslogd
(it doesn't have the confusing '-S' vs '-s' distinction).
I'm a bit concerned that it was possible to fill up mclpool with an
inbound UDP flooding attack; we should queue-limit any inbound queues
and discard when they get too long, allowing us to discard packets as
fast as the driver can read them. This requires a bit more analysis
(to see where all the mbufs are going).
In an ideal world, under a high-rate packet flood we'd also disable
the interrupt and switch to polling the interface, so that the cpu
could spend at least some of its time doing work other than processing
receive interrupts.
From: "Brian A. Seklecki" <lavalamp@spiritual-machines.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: security/10397: syslogd -s vulnerable to flooding.
Date: Fri, 15 Sep 2006 08:59:21 -0400
I think the general understanding in 2006 (this ticket from early 2000)
is a rejection of concept of "default trusted" hosts.
Any service that relies on UDP, lacks internal/external ACL support,
etc, would be rate/limited or controlled using a system-level firewall
(pf(4), etc.) and run in a sandbox (chroot(2), privsep, etc.).
Bloating up the code with internal rate limiting controls may be beyond
the mandate of in-tree syslogd(8).
~BAS
State-Changed-From-To: open->closed
State-Changed-By: elad@netbsd.org
State-Changed-When: Sun, 08 Oct 2006 17:34:50 +0000
State-Changed-Why:
mr. Seklecki hit the jackpot - he's 100% right.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.