GPU Memory Flaws Put AI Conversations at Risk
Terminator Cybersecurity By What The Future Newsroom · January 16, 2024 · 3 min read

GPU Memory Flaws Put AI Conversations at Risk

Researchers found the LeftoverLocals vulnerability in some Apple, AMD, and Qualcomm GPUs, which can expose data left in GPU memory to an attacker who already has some access to a device. Companies have released or announced fixes, but getting updates to users depends on device makers as well as chip companies.

A flaw called LeftoverLocals can let an attacker with some operating system access read data left in the memory of certain graphics processing units (GPUs). That data may include prompts and responses from large language models (LLMs), as well as the weights used to generate responses.

“The flaw could expose private AI conversations to an attacker who already has access to a vulnerable device.”Why it scores Terminator

Researchers at Trail of Bits found the vulnerability in GPUs from Apple, AMD, and Qualcomm. The finding highlights a privacy risk as GPUs take on more artificial intelligence work: information processed by a chip may remain accessible to other software running on the same device.

How LeftoverLocals exposes GPU data

Computers and servers are designed to keep the data of different users and processes separate, even when they share processing resources. LeftoverLocals can weaken that separation by allowing a program with access to the device to retrieve information from vulnerable GPU memory.

The researchers say an attacker would first need some operating system access on the target device. The flaw is therefore not described as a way to break into a device on its own. But once an attacker has a foothold, the data in GPU memory could provide a view into work that another application has recently performed.

In a proof of concept, the researchers had a target ask the open source LLM Llama.cpp for information about WIRED magazine. An attacker’s device then collected most of the model’s response within seconds. The attack program used less than 10 lines of code.

Trail of Bits engineering director for AI and machine learning assurance Heidy Khlaaf said the researchers observed leaks ranging from 5 megabytes to 180 megabytes. The material available to an attacker depends on what the GPU has processed and what remains in its memory.

Which chips and devices were affected

The researchers tested 11 chips from seven GPU makers, along with multiple programming frameworks. They found LeftoverLocals in GPUs from Apple, AMD, and Qualcomm. Those companies confirmed to WIRED that they were affected.

Examples cited in the research include the AMD Radeon RX 7900 XT, Apple’s iPhone 12 Pro, and M2 MacBook Air. In a retest on January 10, the researchers found that the M2 MacBook Air remained vulnerable, while the iPad Air 3rd generation A12 appeared to have been patched.

Apple said it shipped fixes with its M3 and A17 processors, which it unveiled at the end of 2023. That leaves earlier generations of Apple silicon relevant to the issue. The researchers did not find evidence of LeftoverLocals in Nvidia, Intel, or Arm GPUs, and did not find the flaw in the Imagination GPUs they tested. Their findings do not establish that every model from those makers is clear.

Fixes depend on more than chipmakers

Qualcomm said it was in the process of providing security updates to its customers and urged end users to install updates when device makers make them available. Trail of Bits said Qualcomm confirmed that firmware patches had been released.

AMD announced plans for optional mitigations in March. Google said it had released fixes for ChromeOS devices with affected AMD and Qualcomm GPUs. Apple pointed to fixes in newer processors.

Getting a fix from the chipmaker to the person using a device can take coordination. Device manufacturers need to package and deliver protections for the products that use those chips. As a result, a patch existing somewhere in the supply chain does not necessarily mean every affected device has received it.

Why the issue matters for AI privacy

GPU memory may hold information from a range of applications, not just AI chat sessions. The researchers warned that machine learning in a mobile medical health app, for example, could involve sensitive patient support data. The vulnerability’s significance comes from the possibility that software already present on a device could inspect information another process left behind.

Tyler Sorensen, the Trail of Bits researcher who found the flaw, said that someone on the same system could listen in on an LLM chat session and its responses. AMD, while describing the scratchpad memory at issue, said it believed there was no exposure to other parts of the system and no user data was compromised.

The researchers also note that attackers often combine vulnerabilities, so the access required for LeftoverLocals could be obtained through another weakness. For users, the practical step is to apply security updates from their device makers as they become available. The broader lesson is that GPU memory privacy matters as these chips handle more than graphics.

CybersecurityArtificial intelligenceGPUsData privacy
← Back to the wire

Read next