A security feature explicitly designed to prevent modifications to certain files and folders on Apple’s OS X El Capitan desktop operating system can not only be bypassed, but also actually be used to make malware harder to remove from an infected system.
That’s according to Pedro Vilaça, lead OS X security researcher at SentinelOne, who disclosed full details of the vulnerability at the SysCan360 conference in Singapore this week after first informing Apple of the issue.
The zero-day vulnerability exists in all versions of OS X including El Capitan. But it has been addressed in the latest update to the operating system (OS X 10.11.4) that Apple announced March 21. According to SentinelOne, patches will be available soon for the affected OS X versions.
A SentinelOne blog post described the flaw as a non-memory corruption bug that would allow an attacker to escalate privileges on a system and execute arbitrary code on it. Importantly, it allows an attacker to completely bypass System Integrity Protection (SIP), a security feature that Apple introduced with El Capitan last year.
SIP is supposed to prevent users, even those with root access, from modifying certain files and folders in the operating system. The feature is designed essentially to limit the ability of users to make potentially risky changes to their systems. But a weakness in how SIP has been implemented allows attackers a way to bypass it, says Vilaça who has developed an exploit showing how to exploit the flaw.
“The exploit can be used to control any entitlement given by Apple to a certain binary,” Vilaça said in comments to Dark Reading. Apple has authorized certain binaries to make modifications so it can make needed updates to the system, he says. Those same binaries can be leveraged to get around SIP.
An attacker could use the exploit to load unauthorized kernel code on to a system so as to fully disable SIP protections inside the kernel, he says. The exploit allows code execution and sandbox escape without compromising the kernel so it is not detected by SIP, he says. As a result, it could be exploited in state-sponsored and highly targeted attacks.
To exploit the flaw however, an attacker would first need to find a way to compromise an OS X system. The flaw is not directly exploitable remotely, so an attacker would need to try and compromise a system first via a spearphishing attack or through a browser exploit.
By escalating privileges to root access, an attacker would have read and write privileges to all areas of the file system and potentially take control of the whole system, Vilaça said.
Guillaume Ross, senior security consultant at Rapid7 said the vulnerability that Vilaça disclosed this week is particularly problematic for systems administration who have to manage OS X servers used by multiple users via SSH or screen-sharing. “For shared OS X computers such as those found in schools, this vulnerability should be considered very dangerous, as legitimate users could attempt to use it to elevate privileges and take control of the system, or other users’ data,” he said in a statement.
“Privilege escalation bugs like this are often used as a second step – they come after an attack or where malware has taken control of the system,” he says. In order for such flaws to work, an attacker would need to find a way to leverage existing malware on a system or gain physical access to a system, he said.
The latest vulnerability is another indication that Apple’s technologies are not as immune to attacks as many generally believe.
Security vendor Cybereason Labs earlier this month published a report highlighting how the Mac OS X is as vulnerable to malicious attacks as other systems. Adversaries haven’t focused a whole lot on Mac malware because the platform’s market share is relatively low compared to Windows-based software. But just because fewer threats target OS X doesn’t mean it is immune to attacks, Cybereason senior security researcher, Amit Serper wrote in the report.
As examples, he pointed towards the recently disclosed KeRanger ransomware targeting Macs that was discovered by Palo Alto Networks and another flaw dubbed OceanLotus discovered by Qihoo 360, a Chinese firm.
“There are also zero-day attacks that exploit OS X and iOS 7, according to Hacking Team emails that emerged after the company was breached last July,” Serper reminded in his report. “Not to stoke security fears, but there may be other zero-day attacks as well.”
- First Fully Functional Mac Ransomware Contained Before It Could Cause Havoc
- The State of Apple Security
- Mobile Security: Why App Stores Don’t Keep Users Safe