Some of the computer security boffins who revealed last year’s data-leaking speculative-execution holes have identified yet another side-channel attack that can bypass security protections in modern systems.
While side channel attacks like Spectre and Meltdown exploited chip design flaws to glean privileged information, this one is hardware agnostic, involves the Windows and Linux operating system page cache, and can be exploited remotely, within limits.
In a paper provided to The Register in advance of distribution early next week through ArXiv, researchers from Graz University of Technology, Boston University, NetApp, CrowdStrike, and Intel – Daniel Gruss, Erik Kraft, Trishita Tiwari, Michael Schwarz, Ari Trachtenberg, Jason Hennessey, Alex Ionescu, and Anders Fogh – describe a way to monitor how certain processes access memory through the operating system page cache.
“We present a set of local attacks that work entirely without any timers, utilizing operating system calls (
mincore on Linux and
QueryWorkingSetEx on Windows) to elicit page cache information,” wrote the researchers. “We also show that page cache metadata can leak to a remote attacker over a network channel, producing a stealthy covert channel between a malicious local sender process and an external attacker.”
Access to such otherwise hidden information allows the bit boffins to conduct local attacks such as bypassing sandbox protections, interface redressing, and keystroke-timing attacks on a PHP password generation script. The technique can also be adapted to operate remotely, though such exploitation would have to be tailored for specific targets and hardware and would need to incorporate hardware timing measurement. The researchers consider their page cache side channel attacks comparable in terms of performance to hardware cache attacks.
In short, this side-channel attack can be used by rogue users and malware running on a vulnerable system to potentially siphon secret data from other applications, or can be potentially exploited remotely over a network in limited circumstances.
The Windows kernel has been updated to mitigate the attack, and changes should be making their way to users soon.
The operating system’s page cache stores, in RAM, chunks of executables, libraries, and assorted data, that are otherwise held on disk and are regularly used by applications and the operating system. Rather than slowly pull information from, or write information to, disk when accessing these files, it’s much faster to load the objects once from disk into memory, access that memory, and deal with any writes later on.
These cached pages can be mapped into the virtual memory areas of multiple processes at the same time. For example, a code library can be loaded into physical memory once, and mapped into multiple applications’ virtual memory spaces, saving physical RAM and time.
Such sharing of memory, and bringing it in and out of the cache when needed, opens avenues of attack: it’s possible to snoop on access patterns of other programs and extract data based on which information is copied or moved between the disk and cache.
Local or remote?
For the local attack, the researcher’s technique assumes the hacker and victim are running processes under the same operating system or in isolated sandboxes with shared files. The method uses the
mincoresystem call on Linux and the
QueryWorkingSetEx system call on Windows to determine which pages in a memory range are present in the page cache and which are not.
The remote attack looks to measure soft page faults: errors that occur when an application touches memory that is valid but doesn’t have physical pages assigned to it at that moment, causing the operating system to allocate any necessary pages. It involves an attacker running a process on a remote server that measures the latency in accessing public files.
In an email to The Register, researcher Daniel Gruss, one of the paper’s coauthors, characterized the work as mainly a matter of academic interest; it has been responsibly disclosed and, for Windows at least, patched.
“We think this is an important step in showing that on the operating system level, we run into the exact same problems as on the hardware level,” he said.
According to Gruss, the vulnerability was addressed in Windows 10 Insider Preview Build 18305, although he’s not sure when the patch will appear in a formal public release.
The fix requires the PROCESS_QUERY_INFORMATION flag for
QueryWorkingSetEx instead of PROCESS_QUERY_LIMITED_INFORMATION, so less privileged processes cannot directly access page cache information. It also omits Share Count information, the number of processes a page has in its working set, which can be useful for making indirect observations of changes in other processes.
The Linux security team is said to be aware of the issue though the paper provides no details about mitigation efforts. The developers of phpMyFAQ, used to demonstrate the PHP password generation attack, were also informed of the work and are, apparently, working on a corrective patch.