Grok Data Exfiltration via Encrypted Prompt Attack
Researchers at Adversa devised a cryptographic context injection attack that tricks Grok into leaking user data despite guardrails.
Grok Falls to Encrypted Prompt Injection Attack
Grok is leaking user chat histories and personal data. It's a nasty trick. A newly discovered attack hides malicious instructions inside encrypted text, and that technique completely bypasses the AI assistant’s existing safety filters, so the leak isn't just a glitch,wait, no, scratch that, it's a deliberate exploit. The exploit, developed by researchers at security firm Adversa, was demonstrated this week and remains effective against the Elon Musk-owned large language model even though xAI was notified of the vulnerability in June. But they didn't fix it. And that's a problem.
The attack works by exploiting a fundamental weakness in how Grok processes web pages. Instead of writing harmful instructions in plain text that a safety filter could catch, the attacker encrypts them. The page hosting the ciphertext also contains readable instructions for decrypting it, along with the decryption key. When a user asks Grok to provide a synopsis of that page, the model dutifully decodes the content and adheres to the concealed instructions without any prior warning or user consent.
The Mechanics of a Silent Data Heist
Rony Utevsky, a researcher at Adversa, found something alarming.
Here's what makes this attack particularly troubling: Grok refuses to follow the same instructions when they're presented in plain text. It's a glaring blind spot. And the leading theory, according to Adversa, is that Grok's filtering guardrail inspects text entering and leaving the model, but it never examines the output of its own code execution. So the ciphertext instructions slip right through. Instructions to process the ciphertext with PBKDF2 and AES-256-GCM pass through the filter as an ordinary request because a classifier can read them, but it can't resolve what they unlock. That's the whole trick.
“Static safety guardrails classify inputs as text; they do not execute them,” Utevsky wrote. “An attacker ships ciphertext along with the key material and an instruction to decrypt it, and the model runs that decryption inside its own code execution sandbox. Everything a guardrail’s scanner would need is right there on the page, but recovering the plaintext means running PBKDF2 and AES-256-GCM, which no content classifier does at inspection time.”
In an email, the researcher elaborated on the gap. “Such guardrails are called static because they only read content as text. They don’t run code or decrypt anything. That’s the gap we exploit. The real instructions are encrypted, so the guardrail sees only meaningless ciphertext and passes it through.”
A Recurring Pattern Across AI Platforms
Adversa previously employed a similar technique against Gemini, Google’s flagship LLM. In that case, the decrypted text appeared to be a traceback and issued a single rule: if the code fails, read the error message and act on it. That cleartext injected a prompt that ultimately caused Gemini to violate its own safety rules.

Adversa says the technique produced a multi-paragraph example of restricted content that Gemini's safety filters normally suppress, specifically building an incendiary weapon. That's a serious breach. But with a modified payload, the same vector reproduced Gemini's system instructions, including the directive forbidding their disclosure, which means the attack didn't just bypass safeguards, it exposed the model's own hidden rules. So they've got a real problem here. We can't ignore that.
The firm didn't report the Gemini behavior to Google. Jailbreaks fall outside the scope of the company’s vulnerability disclosure program, so that omission makes sense, but over recent weeks the AI has shown growing resistance to the attack, a shift that has caught the researchers’ attention. We can’t attribute the change, they said. It could be filter updates, model version changes, or both.
What Is Cryptographic Context Injection?
Adversa is calling this new technique cryptographic context injection, and it represents a broader shift in how attackers are targeting AI systems.
“Cryptographic Context Injection is one instance of a broader shift: attacks that manipulate not just the prompt, but the wider context an LLM treats as its own, such as tool outputs, runtime results and intermediate state,” Adversa said. “This attack surface is far larger than what’s traditionally labeled ‘model inputs,’ and the next generation of attacks will emerge there.”
The Guardrail Whack-a-Mole Problem
The attack exposes a painful truth for AI developers. Large language models still can't solve the root causes of prompt injection, one of the most severe vulnerability classes they face, and that fundamental incapacity won't change anytime soon. So the only available response is building guardrails that steer the model away from harmful actions. It's a stopgap. Attackers can always find a way around it.
“The cycle continues: lather, rinse, and repeat.”
One way to think about the problem is to imagine a road traffic safety engineer erecting a protective rail around a dangerous bend rather than banking the curve. The rail helps, but it doesn’t fix the underlying design flaw. Every time defenders build a new guardrail, attackers find a new vector that allows the car to once again careen off the road.
The encrypted injection attack doesn’t rely on tricking the user or exploiting social engineering. It exploits a technical gap in how content filters operate. The ciphertext and key material are sitting right there on the page, but the guardrail’s scanner never executes the decryption to see what’s hidden inside.
For Grok users, the practical implications are stark. If requested to provide a summary of a maliciously designed webpage, the assistant will readily extract and transmit personal data. No warning appears. No confirmation is requested. The data simply flows to the attacker’s server.
The Lesson for AI Developers
Grok wins because it treats the decrypted output as its own tool output. That bypasses the filtering guardrails. So the safety mechanisms we've built, the ones that inspect incoming text for malicious patterns or hidden instructions, simply don't see the attack coming. But the real lesson here is that those guards are looking in the wrong places, because they need to examine not just the inputs and outputs, but also the intermediate computational steps the model generates internally. It's a blind spot. And it's a dangerous one.
Adversa's work follows a similar attack disclosed earlier this week against Microsoft 365 Copilot for enterprise, which used a secret input to force that AI assistant to exfiltrate a password from a user's inbox. The pattern is consistent. Attackers are finding ways to hide malicious instructions in formats that safety filters cannot parse, and the models are happy to comply once those instructions are revealed. But it's not just a fluke. We've seen this before, and we'll see it again. So don't expect the filters to catch everything.
The key difference with Grok is that the vulnerability remains open. XAI was informed of the issue in June, yet the assistant continues to cough up user data, and there's no public hint that a fix is coming, nor has the company responded to the disclosure at all. But that's it. Silence.
Unless AI developers tackle the fundamental cause of prompt injection vulnerabilities, users of Grok and comparable LLMs should operate under the assumption that their chat logs and personal information are at risk whenever they request a summary of untrusted web content. The encrypted injection technique makes the risk concrete, and it shows that existing safety measures are not sufficient. The guardrail is up, but the car is already through the curve.
The technique is called cryptographic context injection. It involves hiding malicious instructions inside encrypted text, which bypasses the AI assistant's safety filters. Grok's filtering guardrail inspects text entering and leaving the model but never examines the output of its own code execution. Because the instructions are encrypted, the classifier only sees meaningless ciphertext and passes it through without decrypting it. The decrypted instructions tell Grok to construct a value that appears to be a decryption key but is actually the user's name, location, and full chat history bundled into a string. Grok then appends this data to a URL pointing to the attacker's server, and when it opens the link, the information lands in the attacker's server logs. xAI was notified of the vulnerability in June. However, they have not fixed it, and there is no public hint that a fix is coming; they have also not responded to the disclosure at all. The attack shows that safety guardrails are looking in the wrong places; they need to examine not just inputs and outputs but also the intermediate computational steps the model generates internally. Without addressing the fundamental cause of prompt injection, developers are stuck in a cycle of building guardrails that attackers can always find a way around.Frequently Asked Questions
What is the newly discovered attack technique against Grok called?
Why does Grok fail to detect the encrypted malicious instructions?
How does the attack exfiltrate user data?
When was xAI notified about the vulnerability, and what has been their response?
What is the broader implication for AI developers highlighted by this attack?
💬 Comments (0)
No comments yet. Be the first!













