Researchers have identified a local privilege escalation (LPE) vulnerability in the Mac OS X operating system. Apple seems to be aware of the security hole, but the company hasn’t fixed it in current releases.
The flaw, which affects OS X 10.10.x, was publicly disclosed on Tuesday by German researcher Stefan Esser, founder of security audit company SektionEins. The vulnerability is related to DYLD_PRINT_TO_FILE, an environment variable that enables error logging to arbitrary files. The feature was introduced by Apple to the dynamic linker “dyld” with the release of OS X 10.10.
“When this variable was added the usual safeguards that are required when adding support for new environment variables to the dynamic linker have not been used. Therefore it is possible to use this new feature even with SUID root binaries. This is dangerous, because it allows to open or create arbitrary files owned by the root user anywhere in the file system,” Esser explained in a blog post.
“Furthermore the opened log file is never closed and therefore its file descriptor is leaked into processes spawned by SUID binaries. This means child processes of SUID root processes can write to arbitrary files owned by the root user anywhere in the filesystem. This allows for easy privilege escalation in OS X 10.10.x,” Esser added.
Esser has published technical details on the vulnerability and explained how it can be exploited for full privilege escalation. He has also released a proof-of-concept (PoC) exploit that provides a local root shell.
While Esser decided to take the full disclosure approach and not notify Apple before making his findings public, it appears this vulnerability was reported to the company months ago by the South Korean researcher known as “beist.”
However, Apple only fixed the flaw in the beta versions of OS X El Capitan 10.11, and not in the current OS X 10.10.4 or the beta version of OS X 10.10.5. OS X 10.11 is expected to be released in late September or early October.
Esser has pointed out that the local privilege escalation vulnerability also affects jailbroken iPhones running iOS 8.x.
The researcher advises users who don’t want to wait around for an official fix from Apple to install SUIDGuard, a kernel extension designed to provide protection against attacks leveraging vulnerabilities related to SUID/SGID binaries.
In late June, Apple released patches for several high-profile vulnerabilities, including the ones known as rootpipe, Dark Jedi, Masque, and Rowhammer. At the time, the company fixed nearly 80 security bugs with the release of OS X 10.10.4.