Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Re: LD_LIBRARY_PATH mangled on SUID program
  2000-02-03  5:00 LD_LIBRARY_PATH mangled on SUID program Richard
  2000-02-03  5:00 ` Rob Urban
@ 2000-02-03  5:00 ` Tim Mooney
  2000-02-04  5:00 ` John Goodbody
  2000-02-11  5:00 ` Richard
  3 siblings, 0 replies; 5+ messages in thread
From: Tim Mooney @ 2000-02-03  5:00 UTC (permalink / raw)


In article <87cab9$h5v$1@news.gov.on.ca>,
Richard <richard.abraham@mnr.gov.on.ca> wrote:
> Dear List:
> 
> This is the second time I have run into this.  Does anyone have a work
> around?
> 
> I have a user with a particular LD_LIBRARY_PATH variable set.  I want the
> user to run a program with 4755 protection.  The LD_LIBRARY_PATH of the user
> wishing to run the program becomes mangled by a prepended string which
> appears as follows when it is od'd from an output file.

If the LD_LIBRARY_PATH is required for the particular application, they're
out of luck.  As a (correct!) security precaution, the runtime loader will
ignore LD_LIBRARY_PATH for any setuid or setgid programs unless the user
is already root.  This is hinted at in the loader(5) man page, and probably
stated more forcefully elsewhere.  Other Unix platforms that support
LD_LIBRARY_PATH or its moral equivalent do the exact same thing -- ignore
the user's LD_LIBRARY_PATH for setuid and setgid programs so the user can't
spoof routines that may get executed with elevated privs.

In this particular case, why you're getting the junk you're seeing is
unknown (to me, anyway).  It's probably moot, though, since you're desired
goal isn't going to work anyway.

You may want to investigate either using executable or library RPATH's
(check out the `-rpath' option to ld, for when the library or executable is
built), or static linking of the program.  That way the user can unset the
LD_LIBRARY_PATH and the problem will hopefully go away.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J1, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LD_LIBRARY_PATH mangled on SUID program
  2000-02-03  5:00 LD_LIBRARY_PATH mangled on SUID program Richard
@ 2000-02-03  5:00 ` Rob Urban
  2000-02-03  5:00 ` Tim Mooney
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Rob Urban @ 2000-02-03  5:00 UTC (permalink / raw)


Richard wrote:
> wishing to run the program becomes mangled by a prepended string which
> appears as follows when it is od'd from an output file.
> 
>   del   2   1   2    del   1   8   1
> 
> when echoed to the screen it is:  j212j181 (the j's have 2 dots above each)

the loader is munging the value to close the security hole mentioned in
another
reply.

I don't know why, but it seems the loader is prefixing

	0377 <UID> 0377 <GID> 0377

to the value, where UID is your user-ID and GID is your group-ID

Rob Urban



^ permalink raw reply	[flat|nested] 5+ messages in thread

* LD_LIBRARY_PATH mangled on SUID program
@ 2000-02-03  5:00 Richard
  2000-02-03  5:00 ` Rob Urban
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Richard @ 2000-02-03  5:00 UTC (permalink / raw)


Dear List:

This is the second time I have run into this.  Does anyone have a work
around?

I have a user with a particular LD_LIBRARY_PATH variable set.  I want the
user to run a program with 4755 protection.  The LD_LIBRARY_PATH of the user
wishing to run the program becomes mangled by a prepended string which
appears as follows when it is od'd from an output file.

  del   2   1   2    del   1   8   1

when echoed to the screen it is:  j212j181 (the j's have 2 dots above each)

Any help or guidance or even explanation would be appreciated.

I am running Compaq Tru64 Unix version 4.0f.

Thanks in advance.

Richard Abraham







^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LD_LIBRARY_PATH mangled on SUID program
  2000-02-03  5:00 LD_LIBRARY_PATH mangled on SUID program Richard
  2000-02-03  5:00 ` Rob Urban
  2000-02-03  5:00 ` Tim Mooney
@ 2000-02-04  5:00 ` John Goodbody
  2000-02-11  5:00 ` Richard
  3 siblings, 0 replies; 5+ messages in thread
From: John Goodbody @ 2000-02-04  5:00 UTC (permalink / raw)


Yes, we hit this problem and assumed it was a 'bug' although I now see that
it could be a valid security precaution.

We have control of the source code of the the program which calls setuid /
setgid and coded it to strip off the first 8 bytes of LD_LIBRARY_PATH and
then re-set it with setenv.  Not very pleasant, but it works (for now...).

John.


Richard wrote in message <87cab9$h5v$1@news.gov.on.ca>...
>Dear List:
>
>This is the second time I have run into this.  Does anyone have a work
>around?
>
>I have a user with a particular LD_LIBRARY_PATH variable set.  I want the
>user to run a program with 4755 protection.  The LD_LIBRARY_PATH of the
user
>wishing to run the program becomes mangled by a prepended string which
>appears as follows when it is od'd from an output file.
>
>  del   2   1   2    del   1   8   1
>
>when echoed to the screen it is:  j212j181 (the j's have 2 dots above each)
>
>Any help or guidance or even explanation would be appreciated.
>
>I am running Compaq Tru64 Unix version 4.0f.
>
>Thanks in advance.
>
>Richard Abraham
>
>
>
>





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LD_LIBRARY_PATH mangled on SUID program
  2000-02-03  5:00 LD_LIBRARY_PATH mangled on SUID program Richard
                   ` (2 preceding siblings ...)
  2000-02-04  5:00 ` John Goodbody
@ 2000-02-11  5:00 ` Richard
  3 siblings, 0 replies; 5+ messages in thread
From: Richard @ 2000-02-11  5:00 UTC (permalink / raw)


To List:

I am replying to my own message as I have found a very simple work around.

In our case the LD_LIBARY_PATH was required by ESRI software's installation
instructions.

I simply moved the files in the directory specified by LD_LIBRARY_PATH to
/usr/local/lib.  The loader looks for them
there by default.  No problem after that.

e.g.  setenv LD_LIBRARY_PATH /apps/arcexe72/lib

is unecessary if files in /apps/arcexe72/lib exist in /usr/local/lib or
several other areas specified as the default path in the loader manual page.

Thanks for the suggestions.

Richard
Richard wrote in message <87cab9$h5v$1@news.gov.on.ca>...
>Dear List:
>
>This is the second time I have run into this.  Does anyone have a work
>around?
>
>I have a user with a particular LD_LIBRARY_PATH variable set.  I want the
>user to run a program with 4755 protection.  The LD_LIBRARY_PATH of the
user
>wishing to run the program becomes mangled by a prepended string which
>appears as follows when it is od'd from an output file.
>
>  del   2   1   2    del   1   8   1
>
>when echoed to the screen it is:  j212j181 (the j's have 2 dots above each)
>
>Any help or guidance or even explanation would be appreciated.
>
>I am running Compaq Tru64 Unix version 4.0f.
>
>Thanks in advance.
>
>Richard Abraham
>
>
>
>





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-02-11  5:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-02-03  5:00 LD_LIBRARY_PATH mangled on SUID program Richard
2000-02-03  5:00 ` Rob Urban
2000-02-03  5:00 ` Tim Mooney
2000-02-04  5:00 ` John Goodbody
2000-02-11  5:00 ` Richard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox