Cryptographic Context Injection: New Attack Bypasses AI Security, Exfiltrates User Data from xAI's Grok
A novel attack technique, dubbed "Cryptographic Context Injection" by **Adversa AI**, has been revealed to enable the exfiltration of sensitive user data from **xAI's Grok chatbot**. This method bypasses standard content classifiers by embedding malicious instructions within encrypted payloads, which the AI is tricked into decrypting and executing, leading to unauthorized data transfer.
AI security firm **Adversa AI** has unveiled a sophisticated attack technique capable of compelling **xAI's Grok chatbot** to transmit a user's personal information and ongoing conversation prompts to an attacker-controlled server. The technique, termed **"Cryptographic Context Injection,"** leverages Grok's internal Python code execution runtime to bypass conventional security filters.
### The Mechanics of the Attack
The core of the attack lies in delivering an attacker's instructions as ciphertext within an ordinary web page. This page contains an encrypted JSON object, the necessary key material, and an instruction for Grok to decrypt it. Crucially, content classifiers typically do not perform the cryptographic operations (like **PBKDF2** and **AES-256-GCM**) required to reveal the plaintext, allowing the malicious instructions to reach the model's context as the output of executed code rather than flagged web content.
As **Rony Utevsky**, lead researcher at **Adversa AI**, explains, "Strong encryption cannot be read by a content classifier and cannot be shortcut in-weights, so it forces recovery through the runtime the attack depends on." Once decrypted, these instructions direct Grok to resolve its private session context and embed this sensitive data β including the user's name, approximate location, subscription tier, and chat history β into a URL it is told to open to "fetch additional context." Grok then invokes its navigation tool to load this URL, inadvertently sending the user's data in the request's query parameters.
### Proof-of-Concept and Scope
**Adversa AI** demonstrated this attack against the **Grok** web chat running **Grok 4.5 Fast**, successfully reproducing it on August 19, 2026. The company reported a 40% success rate across 20 attempts since June, with failures attributed to Grok's decryption struggles rather than detected prompts. The extracted data was limited to the ongoing conversation and information already within the model's immediate context. **Adversa AI** did not test whether the agent could access other chats or agent memory.
### Disclosure and Response
**Adversa AI** reported the issue to **xAI** on June 3, 2026, and simultaneously submitted it to **xAI's HackerOne** bug bounty program. While **xAI** acknowledged the report, specifics or a mitigation timeline were not provided, and subsequent contact attempts went unanswered. As of August 20, 2026, **xAI** has not released a public statement or advisory regarding this research. **Adversa AI** is withholding operational payloads to prevent real-world exploitation.
This isn't the first time **Grok's** handling of prompt injection reports has faced scrutiny. In December 2024, **Johann Rehberger** demonstrated a data exfiltration chain against **Grok** in the **X iOS app**, where an indirect prompt injection led to the assistant sending chat information to a third-party server. **Rehberger** reported that **xAI** closed these issues as "Informational," stating, "I'm not sure how leaking user's chat messages and IP address is not a vulnerability, the question is more about severity."
### Broader Implications and Similar Findings
**Adversa AI's** writeup also includes a separate demonstration targeting **Google's Gemini** in Deep Thinking mode. Here, a prompt causes **Gemini** to decrypt a payload that resolves into a fabricated Python traceback, carrying a bogus safety-policy deactivation callback. This vector produced restricted content and reproduced **Gemini's** system instructions (**Gemini 3 Flash (Web)** on the paid tier). **Google** was not notified, as jailbreaks are considered out of scope for their disclosure program.

The research aligns with other recent findings in the AI security landscape. **Alexander Panfilov** and co-authors published a preprint on August 10, 2026, highlighting that encrypted chain-of-thought blocks returned by **Anthropic**, **OpenAI**, and **Google** to API clients are interchangeable, enabling "invisible prompt injections" to poison public agentic rollouts. Additionally, researchers at **UC Berkeley**, the **Ethereum Foundation**, and **NYU Shanghai** presented work at **USENIX Security 2026** demonstrating a two-turn attack against **Grok 3** where a substitution cipher, followed by a request to act on the decoded text, succeeded on all 12 tested malicious intents.
### Mitigation Strategies for Agent Developers
**Adversa AI** emphasizes that the solution does not necessarily lie at the model layer but within the surrounding agent harness. They recommend the following steps for teams running AI agents:
* **Quarantine untrusted content:** Process untrusted content in an isolated context without tools or credentials, returning only structured data to the privileged context.
* **Gate irreversible and outbound actions:** Confirm new network destinations, pushes, merges, publishes, and writes outside the workspace with fully resolved arguments, applying a hard deny if no human is present for approval.
* **Capture per-session tool traces:** Implement detailed logging of tool traces with resolved arguments for effective detection and forensics.
* **Alert on sequence:** Treat an opaque blob paired with decryption instructions as a review signal rather than a blocking filter, recognizing the attack's multi-stage nature.
* **Require context provenance:** Demand vendors provide clear separation between tool output and the instruction channel as a procurement requirement.
This ongoing research underscores the evolving challenges in securing advanced AI models against novel attack vectors, particularly those that exploit the execution environments and tool-use capabilities of these sophisticated systems.