oss-sec mailing list archives

Re: ldd can execute an app unexpectedly


From: "Dmitry V. Levin" <ldv () altlinux org>
Date: Tue, 8 Mar 2011 03:00:11 +0300

On Mon, Mar 07, 2011 at 06:27:05PM -0500, Steve Grubb wrote:
[...]
 http://reverse.lostrealm.com/protect/ldd.html
 http://www.catonmat.net/blog/ldd-arbitrary-code-execution/

Besides telling everyone don't do that. ldd could take the PoV that it should only 
call runtime linkers in trusted directories like /sbin or /usr/sbin. Or it could 
simply detect that another linker was requested and make you add a "--force" so that 
you are fully aware that you just let another linker run. (The suggested patch can 
certainly be improved. But its here just in case you want it.)

In June of 2002, I suggested to change ldd to avoid invoking programs
directly, even when it seems like that would work, and invoke the dynamic
linker as a program instead.
This change was implemented at least in Owl and ALT Linux:
http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/glibc/glibc-2.3.6-owl-alt-ldd.diff
http://git.altlinux.org/gears/g/glibc.git?p=glibc.git;a=commitdiff;h=788577027d2950e9508a434475e04c3af864d169


-- 
ldv

Attachment: _bin
Description:


Current thread: