Skip to content Skip to footer

Here’s How ChatGPT Could Steal Your Data Forever

A Clever Hacker Found a Way to Trick ChatGPT into Remembering False Facts – Here’s How It Could Steal Your Data Forever

Imagine someone planting false memories in your mind without you knowing, creepy, right? Well, that’s exactly what security researcher Johann Rehberger found hackers could do to ChatGPT. It turns out that this clever hacker figured out how to make ChatGPT “remember” things that weren’t true, and even sneak in harmful instructions, all stored in the AI’s memory. The kicker? OpenAI didn’t think it was a big deal at first, simply calling it a “safety issue.”

But Rehberger didn’t stop there. Like any good detective, he pushed forward, creating a demonstration that took things to the next level. He showed that by exploiting this glitch, hackers could steal everything a user ever typed into ChatGPT. And it wouldn’t stop, this data leak would go on forever! That got OpenAI’s attention, and they rushed to put out a partial fix in September.

The secret to this hack lies in ChatGPT’s new memory feature, which OpenAI rolled out earlier this year. This memory helps ChatGPT recall details about you, like your preferences or past conversations, so it doesn’t have to ask the same things over and over. Pretty convenient, right? Well, not if hackers get their hands on that memory! With just a sneaky trick, they could inject false information that sticks with ChatGPT forever, influencing every conversation you have afterward. In one demo, Rehberger tricked the AI into believing a user was 102 years old, lived inside “The Matrix,” and thought the Earth was flat!

These false memories could be planted through everyday activities, like storing files on Google Drive or even by just visiting a website. Once in place, they could be used to guide future conversations in bizarre or dangerous directions, with the user none the wiser.

Johann first reported his discovery to OpenAI in May, but the company didn’t immediately recognize the threat. So, like any determined detective in a crime thriller, Johann came back with proof that made it impossible to ignore. He set up a test where, after clicking a malicious link, everything a user typed into ChatGPT would secretly be copied and sent to his server.

Delving Deeper: How ChatGPT’s Memory Can Be Manipulated

To understand how Johann Rehberger pulled off this feat, we need to take a closer look at how ChatGPT’s memory works under the hood. OpenAI began experimenting with long-term memory for ChatGPT earlier this year, aiming to make interactions more seamless and intuitive. Normally, when you interact with ChatGPT, each conversation starts fresh with no recollection of what you discussed before, kind of like talking to someone with amnesia. However, with memory enabled, ChatGPT retains key details about previous interactions, which helps it personalize responses in future chats.

This memory isn’t stored in your browser or app; it lives on OpenAI’s servers, embedded within ChatGPT’s profile of you. It remembers information like your name, preferences, and even your past requests. This way, it can reference these details to save you the hassle of repeating yourself. But here’s the kicker: memory can also be influenced by outside factors. This is where things start to get tricky.

Johann discovered that ChatGPT’s memory could be tricked into storing fake information using what’s called “indirect prompt injection.” Normally, prompt injection occurs when you directly tell the AI to do something through your conversation. But with indirect prompt injection, the command to the AI is hidden within content that the user unwittingly interacts with, think of it like a Trojan horse. It could be a simple email, a blog post, or a file that the AI processes as part of a normal task. Once the AI processes this hidden instruction, it silently alters its behavior based on the injected prompts.

The Exploit: Hacking ChatGPT’s Memory

Here’s how the exploit works in more technical terms: Rehberger’s proof-of-concept (PoC) relied on ChatGPT’s ability to follow instructions embedded in external content. By embedding malicious instructions within seemingly harmless files or web links, an attacker could manipulate ChatGPT’s memory. For example, a file uploaded to Google Drive or an image hosted on a website could contain hidden commands that the AI unknowingly processes. This action plants a false memory into ChatGPT’s long-term storage, effectively manipulating its behavior.

In one test, Rehberger showed how ChatGPT could be convinced that the user was much older than they actually were or that they held bizarre beliefs. Once this false memory was planted, every future conversation with ChatGPT was influenced by these injected details. The AI would incorporate these false facts into its responses, perpetuating the incorrect information without any obvious indication to the user.

This memory persistence is a critical feature of the exploit. Even if the user ends their current session and starts a new conversation days later, ChatGPT would still refer back to the altered memory, continuing to perpetuate the misinformation. This makes it a potent tool for attackers seeking to exploit the AI’s persistent memory to influence users in the long run.

Exfiltration: The Data Leak Potential

But Rehberger took it a step further. His next PoC was designed to demonstrate how attackers could not only manipulate ChatGPT’s memory but also exfiltrate data. This was the more alarming aspect of the vulnerability. By embedding malicious code into a file or a link, Rehberger was able to trick ChatGPT into continuously sending all user inputs, everything the user typed or discussed, to an attacker’s server.

Here’s how it worked: the attacker would craft a link to a webpage containing a malicious image or file. When ChatGPT interacted with this content, the embedded code executed, instructing ChatGPT to send all subsequent conversations to the attacker’s server. This exfiltration of data could go unnoticed for a long time, as the attacker now had access to both user input and ChatGPT’s generated responses, which could include sensitive information like personal details, passwords, or business conversations.

This exfiltration was made possible because ChatGPT was essentially following the attacker’s hidden instructions, treating them as legitimate tasks. This data leak would persist until the user manually reset their memory settings, something most users wouldn’t think to do unless they were aware of the attack. The attack highlighted a glaring weakness in how AI systems handle indirect inputs and context from external sources.

Mitigation and Partial Fix

Once OpenAI became aware of this vulnerability, they implemented several fixes. The primary change was restricting the ability of memory to be influenced by external inputs, particularly through untrusted sources. OpenAI placed limits on how memory could be updated and added stronger checks to prevent prompt injections from taking hold.

However, this was only a partial fix. While OpenAI mitigated the ability for memory to be used as an exfiltration tool, indirect prompt injection remains a threat. Attackers can still manipulate memory by embedding prompts in content that the AI processes, potentially influencing future interactions. While these injected memories can no longer leak data directly, they can still guide ChatGPT’s behavior, subtly nudging conversations in directions that serve the attacker’s goals.

Protecting Yourself from Prompt Injection

If you’re using ChatGPT or any AI with memory capabilities, it’s crucial to be vigilant. Here are a few practical steps to protect yourself from this form of attack:

    • Monitor Your Memory Settings: Regularly check ChatGPT’s memory logs to see what it has remembered about you. If you spot anything unusual, like strange facts or information you never provided, delete or reset the memory.
    • Be Cautious of External Links: Avoid instructing ChatGPT to interact with untrusted links, files, or images. These could be vectors for prompt injection attacks.
    • Use Trusted Sources: Only allow ChatGPT to process content from sources you trust. This reduces the chances of encountering hidden prompts in files or webpages.
    • Report Anomalies: If ChatGPT behaves unexpectedly, such as referencing details you didn’t provide, report the issue to OpenAI. This could be a sign that your memory has been tampered with.

The good news? OpenAI has since closed the biggest loopholes that allowed memories to be misused. However, there’s still a risk that sneaky hackers could exploit untrusted content to plant their tricks in ChatGPT’s memory. So, if you’re using ChatGPT, keep an eye on what it remembers about you, and double-check those memory logs!