Apple tried to patch this security hole in macOS Finder but didn't consider upper and lowercase characters
file:// is blocked? Oh OK, we'll just use File:// or fiLE://...
Apple's macOS Finder application is currently vulnerable to a remote code execution bug, despite an apparent attempt to fix the problem.
A security advisory published Tuesday by the SSD Secure Disclosure program, on behalf of researcher Park Minchan, explains that macOS Finder – which provides a visual interface for interacting with files – is vulnerable to documents with the
"[T]hese files can be embedded inside emails which if the user clicks on them will execute the commands embedded inside them without providing a prompt or warning to the user," the advisory says.
The files can also execute commands if downloaded and double-clicked. In theory, Apple's macOS security mechanisms Quarantine – for preventing downloads from launching without user action – and Gatekeeper – to enforce code signing – should prevent such problems.
But when The Register tested the PoC file on macOS Big Sur (version 11.6), it executed without any warning. According to security researcher Patrick Wardle, the PoC code bypasses both of those mechanisms.
.inetloc file extension appears to date back to around 2004 but isn't well documented. Apple's own developer website doesn't recognize the term. Nonetheless macOS sees such files as Internet locations.
- Microsoft Exchange Autodiscover protocol found leaking hundreds of thousands of credentials
- Break out your emergency change process and patch this ransomware-friendly bug ASAP, says VMware
- Apache OpenOffice can be hijacked by malicious documents, fix still in beta
- Microsoft's end-of-summer software security cleanse crushes more than 80 bugs
According to the advisory,
.inetloc files serve as shortcuts to Internet resources like an RSS feed or a telnet location and may include a server address and possibly login credentials for SSH or telnet sessions. They can be created by typing a URL in a text editor and dragging the text to the macOS Desktop, if the format and drag-and-drop are supported within the app.
Here's what the PoC file,
inetloc.inetloc for lack of a better name, looks like. If opened in macOS, it will launch the macOS Calculator app.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>URL</key> <string>FiLe:////////////////////////System/Applications/Calculator.app</string> </dict> </plist>
The advisory says Apple told the SSD Disclosure Program that newer versions of macOS, from Big Sur onward, have blocked the
file:// prefix with a check in
com.apple.generic-internet-location. But Apple's engineers evidently failed to consider upper and lower case variations, so alternative renditions of the file handler like
fIle:// still bypass the check.
"We have notified Apple that
FiLe:// (just mangling the value) doesn’t appear to be blocked, but have not received any response from them since the report has been made," the advisory says. "As far as we know, at the moment, the vulnerability has not been patched."
The Register asked Apple for comment knowing it's futile to do so. Our lack of faith has been vindicated by the lack of response. For those keeping score, it's been four months since Apple comms last provided proof of life by responding to a query. ®