[13164] in bugtraq

home help back first fref pref prev next nref lref last post

Re: majordomo local exploit

daemon@ATHENA.MIT.EDU (Andrew Brown)
Fri Dec 31 04:15:15 1999

Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Errors-To: errrors@graffiti.com
Message-Id:  <19991230181626.A24928@noc.untraceable.net>
Date:         Thu, 30 Dec 1999 18:16:26 -0500
Reply-To: Andrew Brown <atatat@atatdot.net>
From: Andrew Brown <atatat@ATATDOT.NET>
X-To:         Henrik Edlund <henrik@EDLUND.ORG>
To: BUGTRAQ@SECURITYFOCUS.COM
In-Reply-To:  <Pine.LNX.4.20.9912300436140.10698-100000@corellia.edlund.org>;
              from henrik@EDLUND.ORG on Thu, Dec 30, 1999 at 04:37:36AM +0100

>This patch should take care of that problem:
>
>--- majordomo.old       Sat Oct  2 02:30:30 1999
>+++ majordomo   Thu Dec 30 04:34:25 1999
>@@ -44,6 +44,25 @@
>     die("$cf not readable; stopped");
> }
>
>+# Check if the cf file is owned by effective uid
>+if ((stat($cf))[4] != $>) {
>+    die("$cf not owned by effective uid; stopped");
>+}
>...
>Comments?

hmm...race condition?

it would really be better (in this vein) to (a) open the config file,
(b) fstat it (once, not twice) and (c) then read and eval the code
rather using require (since you can't "require" a file handle).

of course...using a config file or perl is nice, since you *can*
simply require it, but a parsed config file that just sets variables
is better since it implicitly disallows attacks like this.

--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."

home help back first fref pref prev next nref lref last post