🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #37348

Re: some INN 2.2-stable issues

#37348
From: Forrest J. Cavalier III
Date: Mon, 10 May 1999 00:00
78 lines
3191 bytes
In article <87emkpmtws.fsf@erlenstar.demon.co.uk>, andrew@erlenstar.demon.co.uk wrote...
>
>>>>>> "Forrest" == Forrest J Cavalier <mibsoft@mibsoftware.com> writes:
>
> >> But as he said, inndstart should not be runnable by everyone, and
> >> this is just a tip of the problems if it is.
>
> Forrest> Why allow a user news compromise to turn into a root
> Forrest> compromise?
>
>Why should this happen?
>
>Your analysis is flawed in several respects, notably the fact that
>inndstart restores the 'news' user before execing innd.

Here's the relevant code from inndstart....


    GID_T		NewsGID;
    UID_T		NewsUID;

    if (ReadInnConf() < 0) exit(1);

    /* Make sure INND directory exists. */
    if (stat(innconf->pathrun, &Sb) < 0 || !S_ISDIR(Sb.st_mode)) {
	syslog(L_FATAL, "inndstart cant stat %s %m", innconf->pathrun);
	exit(1);
    }
    NewsUID = Sb.st_uid;
    NewsGID = Sb.st_gid;
    . . .
    . . .
    (void)setuid(NewsUID);

>
>Here's the kicker, though: inndstart *DOES ITSELF* respect the INNCONF
>environment variable!  It simply does not pass it on to innd, but as the
>code stands (at least in the 2.2-stable snapshot I'm working with) the
>path to the innd binary *is* obtained from the file specified in INNCONF.
>

I just looked.  The ReadInnConf code is not what I remember it.  Either
it changed, or my memory changed.  inndstart should NOT be using the
INNCONF from the environment because of the code in inndstart and
the reasons I discussed.

Since ReadInnConf() allows the use of INNCONF environment variable,
user news could change pathrun to point to a root:root owned
directory and get root when inndstart was run.


>
>Then inndstart is already broken.

Seems so.

>
> Forrest> I think changing the code is even more appropriate in this
> Forrest> case, which is why I suggested inn-workers.
>
>I'm not on inn-workers, and I am reluctant to join since INN is
>something I only rarely have occasion to hack on.

It's just a mailing list, not a secret society.  Join for two weeks
and then drop off.  No reason to debate maillist vs Usenet discussion,
the maillist is more appropriate, but if I've explained the problem
so you can understand it, Andrew, then I think you will probably
just fix it and post the patch.  I know you.  

In that case, there is no reason for a discussion on inn-workers
after all.

Forrest




Technical Details
Message-ID: <7h6r63$e78$1@news1.epix.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <87r9oym8wx.fsf@erlenstar.demon.co.uk> <7gprlk$21b$1@news1.epix.net> <7gqe8k$aj0$1@newssvr01-int.news.prodigy.com> <7h5mev$g30$1@news1.epix.net> <87emkpmtws.fsf@erlenstar.demon.co.uk>

Show Full Headers
Complete Article Headers
Message-ID: <7h6r63$e78$1@news1.epix.net>
Subject: Re: some INN 2.2-stable issues
Date: Mon, 10 May 1999 00:00:00 +0000
From: mibsoft@mibsoftware.com (Forrest J. Cavalier III)
References: <87r9oym8wx.fsf@erlenstar.demon.co.uk> <7gprlk$21b$1@news1.epix.net> <7gqe8k$aj0$1@newssvr01-int.news.prodigy.com> <7h5mev$g30$1@news1.epix.net> <87emkpmtws.fsf@erlenstar.demon.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 476191439
Content-Type: Text/Plain; charset=US-ASCII
Organization: Mib Software
Mime-Version: 1.0
Newsgroups: news.software.nntp