Exploitation Summary
EIP tracks 2 public exploits for CVE-2009-4146.
PoCs published by Kingcope, stealth, bcoles, including Metasploit module exploits/freebsd/local/rtld_execl_priv_esc.
AI-analyzed exploit summary The exploit leverages a vulnerability in FreeBSD's Run-Time Link-Editor (rtld) to bypass restrictions on environment variables like LD_PRELOAD for setugid binaries, achieving local privilege escalation to root. It uses a crafted environment setup and a shared library to execute arbitrary commands with elevated privileges.
Description
The _rtld function in the Run-Time Link-Editor (rtld) in libexec/rtld-elf/rtld.c in FreeBSD 7.1, 7.2, and 8.0 does not clear the LD_PRELOAD environment variable, which allows local users to gain privileges by executing a setuid or setguid program with a modified LD_PRELOAD variable containing an untrusted search path that points to a Trojan horse library, a different vector than CVE-2009-4147.
Exploits (2)
The exploit leverages a vulnerability in FreeBSD's Run-Time Link-Editor (rtld) to bypass restrictions on environment variables like LD_PRELOAD for setugid binaries, achieving local privilege escalation to root. It uses a crafted environment setup and a shared library to execute arbitrary commands with elevated privileges.
This Metasploit module exploits a vulnerability in FreeBSD's run-time link-editor (rtld) where `unsetenv()` fails to remove `LD_*` environment variables, allowing arbitrary shared object loading via `LD_PRELOAD` for privilege escalation.