Exploit database

Vulnerability

CVE-2009-4147

Vulnerability details

Score
7.2
Severity
high

CVSS 2.0 · NVD

Vector string

AV:L/AC:L/Au:N/C:C/I:C/A:C

Description

The _rtld function in the Run-Time Link-Editor (rtld) in libexec/rtld-elf/rtld.c in FreeBSD 7.1 and 8.0 does not clear the (1) LD_LIBMAP, (2) LD_LIBRARY_PATH, (3) LD_LIBMAP_DISABLE, (4) LD_DEBUG, and (5) LD_ELF_HINTS_PATH environment variables, which allows local users to gain privileges by executing a setuid or setguid program with a modified variable containing an untrusted search path that points to a Trojan horse library, different vectors than CVE-2009-4146.

CVE Program

Exploit source choices

2 sources
FreeBSD rtld execl() Privilege Escalation
MSF-freebsd--local--rtld_execl_priv_escMetasploitBSD / remote

This module exploits a vulnerability in the FreeBSD run-time link-editor (rtld). The rtld `unsetenv()` function fails to remove `LD_*` environment variables if `__findenv()` fails. This can be abused to load arbitrary shared objects using `LD_PRELOAD`, resulting in privileged code execution. This module has been tested successfully on: FreeBSD 7.2-RELEASE (amd64); and FreeBSD 8.0-RELEASE (amd64).

2009-11-30rtld_execl_priv_esc.rb