Bugtraq mailing list archives
KSR[T] Advisory #7: filter
From: ksrt () DEC NET (KSR[T])
Date: Thu, 29 Jan 1998 05:29:22 -0800
KSR[T] Advisory #007 Date: Jan 29, 1998 ID #: filt-bof-007 Operating System(s): Any UNIX system running elm/filter Affected Program: filter ( part of the elm-2.4 package ) Problem Description: This advisory covers two vulnerabilities in the filter program. The first is in the function save_embedded_address(), filter will use a while() loop to copy a 5120 byte into a 512 byte automatic variable. This is the From: or in the Reply-To: line in an email message. The second is in the function get_filter_rules(), there is a stack overrun when the function blindly strcpy()s the variable filterfile( which is obtained via the command line parameter '-f' ), into an automatic variable. Compromise: The first problem could potentially be exploited remotely depending upon how the victim's machine's Mail Transfer Agent handles From: or Reply-To: headers that are larger than 512 bytes. This would allow a remote attacker to run arbitrary commands as the user running filter, and possibly additional privileges that will allow the attacker to write to the mail spool directory. Both attacks can be performed locally, however they will only increase privileges if filter is running set-uid or set-gid (most notably Linux machines). This could allow a local user to read other users' mail spools and allows write access to the mail spool directory. The latter could potentially be used to interfere with the mail subsystem. Notes: This was not a full audit on the elm2.4 package, or filter for that matter. At a glance, there appear to be numerous security problems. The filter included in elm-2.4ME+37 also appears to be vulnerable to the "save_embedded_address()" attack, but not to the "get_filter_rules()" attack. Filter will not be a part of elm 2.5, and is not supported in any way at this time. It is the Elm group's recommendation that filter not be used. Patch/Fix: -*- Begin elm 2.4 filter patch -*- diff -u filter/filter.c filter.new/filter.c --- filter/filter.c Tue Feb 4 09:13:02 1997 +++ filter.new/filter.c Tue Feb 4 09:17:38 1997 @@ -429,7 +429,7 @@ **/ static int processed_a_reply_to = 0; - char address[LONG_STRING]; + char address[MAX_LINE_LEN + 1]; register int i, j = 0; /** first let's extract the address from this line.. **/ diff -u filter/parse.c filter.new/parse.c --- filter/parse.c Tue Feb 4 09:13:33 1997 +++ filter.new/parse.c Tue Feb 4 09:17:38 1997 @@ -172,7 +172,8 @@ struct condition_rec *cond, *newcond; - strcpy(filename,filterfile); + memset(filename, 0x0, SLEN ); + strncpy(filename,filterfile,( SLEN - 1 )); if ((fd = fopen(filename,"r")) == NULL) { if (outfd != NULL) -*- end elm 2.4 filter patch -*- -*- begin elm2.4+ME filter patch -*- --- filter/filter.c Tue Feb 4 09:13:02 1997 +++ filter.new/filter.c Tue Feb 4 09:17:38 1997 @@ -429,7 +429,7 @@ **/ static int processed_a_reply_to = 0; - char address[LONG_STRING]; + char address[MAX_LINE_LEN + 1]; register int i, j = 0; /** first let's extract the address from this line.. **/ -*- end elm2.4+ME filter patch -*-
Current thread:
- (AUSCERT ESB-98.009) CERT Advisory CA-98.02 - Vulnerabilities in, (continued)
- (AUSCERT ESB-98.009) CERT Advisory CA-98.02 - Vulnerabilities in Grant Beattie (Jan 21)
- Q179148: Settings May Not Be Applied with URL with Short Filename Aleph One (Jan 23)
- CDE: dtappgather on AIX Marcin Cieslak (Jan 25)
- Simple OpenBSD crash script Jason Downs (Jan 25)
- Re: Simple OpenBSD crash script GvS One (Jan 28)
- Quake 2 Linux kevingeo () CRUZIO COM (Jan 25)
- Re: Quake 2 Linux Greg Alexander (Jan 27)
- Announcement: Phrack 52 route () RESENTMENT INFONEXUS COM (Jan 26)
- Microsoft responds to bug in Exchange Server Tony Hagale (Jan 27)
- Re: Announcement: Phrack 52 Olaf Kirch (Jan 28)
- KSR[T] Advisory #7: filter KSR[T] (Jan 29)
- Bug in IMail's pop3d32.exe RHS Linux User (Jan 29)
- Secure Linux patch Solar Designer (Jan 29)
- Gaining Domain Admins access on LAN (fwd) Weld Pond (Jan 28)
- GZEXE - the big problem Micha? Zalewski (Jan 28)
- Re: Correction: CPSN 9:971208: Solaris /var Permission Problems Tom Perrine (Jan 13)