Article View: news.software.nntp
Article #37344Re: some INN 2.2-stable issues
From: Forrest J. Cavalier III
Date: Mon, 10 May 1999 00:00
Date: Mon, 10 May 1999 00:00
83 lines
4108 bytes
4108 bytes
In article <7gqe8k$aj0$1@newssvr01-int.news.prodigy.com>, davidsen@tmr.com wrote...
>
>In article <7gprlk$21b$1@news1.epix.net>,
>Forrest J. Cavalier III <mibsoft@mibsoftware.com> wrote:
>| In article <87r9oym8wx.fsf@erlenstar.demon.co.uk>, andrew@erlenstar.demon.co.uk wrote...
>| [snip]
>| >
>| > Of course, another program that doesn't honour INNCONF is inndstart,
>| > which deletes it from the environment. I'm not sure if this would be a
>| > security hole or not (inndstart should only be executable by the news
>| > user anyway), but for now I've worked around the problem by running
>| > innd on a nonprivileged port and not using inndstart.
>|
>| The security hole is that INNCONF sets what programs are executed.
>| inndstart must be SUID root, and unless the code changed, inndstart
>| then sets the UID based on the ownership of a directory.
>
>But as he said, inndstart should not be runnable by everyone, and this
>is just a tip of the problems if it is.
Why allow a user news compromise to turn into a root compromise?
Holes discovered and fixed in 1997 were shell exploitable, There has
been a lot of code added and changed since then.
I don't particularly like the code/methods in inndstart, but
here's the scenario it allows....
1. Get shell as user news. (Hypothetical. I know of no exploits,
but I haven't audited the code either.)
2. Replace pathrun in inn.conf with some directory that is UID:GID
root:root.
When inndstart is run (it is SUID root), it will check pathrun,
and then leave the UID as 0, then run innd.
3. Replace innd (or anything that innd calls) with your favorite
trojan, or something that creates your favorite trojan.
4. Kill innd. Someone will notice the news server has stopped,
and restart it.
Bonus points if you include in step #3 something that switches
inn.conf back to the original, and erases the trail.
That's the remote exploit. Any local user who could set INNCONF in
the environment, then launch a SUID inndstart would be able to do
the same thing, so having inndstart runnable only as user news
is prudent, as was pointed out.
There are some systems where the persons with user news access
don't have root access. (This is very rare, but I've seen it.)
Having inndstart under a 0700 user news directory helps keep the
local users out. But in my opinion, it is terrible practice
to have any SUID root program, (or anything that root executes) under
any non-root owned directories. (It is unlikely that the init scripts
are checking the ownership of the files they execute, much less
likely that the ownership of the parent directories are being
checked.)
If something is SUID root, its behavior must be totally defined by
root owned information. It can't be getting information from
non-root environments, the command line, or even inn.conf not
owned by root.
There are lots of possible ways to secure INN startup according to your
personal preferences and definitions of security. But having
a fixed (compile time) path to inn.conf,
and inn.conf owned by root
help a lot to prevent using the existing code to get root from a user
news compromise.
I think changing the code is even more appropriate in this
case, which is why I suggested inn-workers. I wasn't trying
to hide anything. Obscurity is not security.
Forrest
Technical Details
Message-ID:
<7h5mev$g30$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-mailReferences:
<87r9oym8wx.fsf@erlenstar.demon.co.uk> <7gprlk$21b$1@news1.epix.net> <7gqe8k$aj0$1@newssvr01-int.news.prodigy.com>Show Full Headers
Complete Article Headers
Message-ID: <7h5mev$g30$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> 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: 476050516 Content-Type: Text/Plain; charset=US-ASCII Organization: Mib Software Mime-Version: 1.0 Newsgroups: news.software.nntp