mailing list of musl libc
 help / color / mirror / code / Atom feed
* Binaries compiled with musl (1.1.2) are vulnerable to an ancient ldd exploit
@ 2014-06-14 15:35 Steven Honeyman
  2014-06-14 15:50 ` Szabolcs Nagy
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Steven Honeyman @ 2014-06-14 15:35 UTC (permalink / raw)
  To: musl

I noticed this by accident (ran ldd as usual without even thinking)...
but if you compile with musl-gcc, and use shared instead of static,
then ldd can cause different behaviour in the binary (code will
execute). It is described here [1] from 2009, on how to modify uclibc
to enable this behaviour... musl needs no mods to achieve this!

Simple example:

$ echo 'void main() { puts("executed"); }' >lddtest.c
$ musl-gcc lddtest.c && ldd ./a.out

Of course the exploit is only useable if you check for
LD_TRACE_LOADED_OBJECTS and do something different in the code if it
is set.

Thanks,
Steven.

[1] http://www.catonmat.net/blog/ldd-arbitrary-code-execution/


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

end of thread, other threads:[~2014-06-14 19:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-14 15:35 Binaries compiled with musl (1.1.2) are vulnerable to an ancient ldd exploit Steven Honeyman
2014-06-14 15:50 ` Szabolcs Nagy
2014-06-14 15:51 ` Daniel Cegiełka
2014-06-14 16:03   ` Szabolcs Nagy
2014-06-14 16:16     ` Rich Felker
2014-06-14 16:02 ` Rich Felker
2014-06-14 16:10   ` Steven Honeyman
2014-06-14 16:30     ` Rich Felker
2014-06-14 16:14   ` Solar Designer
2014-06-14 16:24     ` Rich Felker
2014-06-14 16:27       ` Steven Honeyman
2014-06-14 16:42         ` Szabolcs Nagy
2014-06-14 17:11           ` Rich Felker
2014-06-14 17:24       ` Solar Designer
2014-06-14 18:29         ` Rich Felker
2014-06-14 18:37           ` Solar Designer
2014-06-14 19:39             ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).