News for hackers. Stuff that matters.
Re:I Built an Ld_preload Worm by singron on Monday April 29, 2024 @09:43PM (#40206400)
The linker is a convenient way to get your code to run in the right place, but the linker runs in userspace, and your code can do anything the linker does. E.g. you can scan function tables, remap pages r/w, and interpose functions.

The OpenBSD folks have some good ideas against these issues, although they are targeted at things like ROP exploits. E.g. pledge, which disables certain syscalls, and immutable memory maps (https://marc.info/?l=openbsd-tech&m=166203784715942).

A really scary version of the xz backdoor is if it had an entire implementation of openssh in its own ctor function. Then it wouldn't even need to interpose anything. It's way harder to get rid of ctors.

Re:I Built an Ld_preload Worm by marcosdumay on Tuesday April 30, 2024 @12:27PM (#40212822)
> E.g. you can scan function tables, remap pages r/w, and interpose functions.

Your code doesn't start doing those things without notice due to external interference.

But a linker will add them, on your behalf, without raising any flags.