USENIX Security2024Top-tier venue
What Was Your Prompt? A Remote Keylogging Attack on AI Assistants
Roy Weiss, Daniel Ayzenshteyn, Guy Amit, Yisroel Mirsky
Abstract
AI assistants are becoming an integral part of society, used for asking advice or help in personal and confidential issues. In this paper, we unveil a novel side-channel that can be used to read encrypted responses from AI Assistants over the web: the token-length side-channel. We found that many vendors, including OpenAI and Microsoft, have this side-channel. However, inferring the content of a response from a token-length sequence alone proves challenging. This is because tokens are akin to words, and responses can be several sentences long leading to millions of grammatically correct sentences. In this paper, we show how this can be overcome by (1) utilizing the power of a large language model (LLM) to translate these sequences, (2) providing the LLM with inter-sentence context to narrow the search space and (3) performing a known-plaintext attack by fine-tuning the model on the target model's writing style. Using these methods, we were able to accurately reconstruct 29% of an AI assistant's responses and successfully infer the topic from 55% of them. To demonstrate the threat, we performed the attack on OpenAI's ChatGPT-4 and Microsoft's Copilot on both browser and API traffic.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers7
- Memory Backdoor Attacks on Neural NetworksEden Luzon, Guy Amit, Roy Weiss, Torsten Krauß et al.NDSS 2026 · 3 citations
- Keytar: Practical Keystroke Timing Attacks and Input ReconstructionMufan Qiu, Lihsuan Chuang, Dohhyun Kim, Huaizhi Qu et al.S&P 2026 · 2 citations
- IOValve: Leakage-Free I/O Sandbox for Large-Scale Untrusted Data ProcessingSangho Lee, Jules Drean, Yue Tan, Marcus PeinadoCCS 2025 · 1 citation
- Network-Level Prompt and Trait Leakage in Local Research AgentsHyejun Jeong, Mohammadreza Teymoorianfard, Abhinav Kumar, Amir Houmansadr et al.USENIX Security 2026 · 1 citation
- I Know What You Said: Unveiling Hardware Cache Side-Channels in Local Large Language Model InferenceZibo Gao, Junjie Hu, Feng Guo, Yixin Zhang et al.USENIX Security 2025
Builds on8
- Quantifying Memorization Across Neural Language ModelsNicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee et al.ICLR 2023 · 158 citations
- DeepSniffer: A DNN Model Extraction Framework Based on Learning Architectural HintsXing Hu, Ling Liang, Shuangchen Li, Lei Deng et al.ASPLOS 2020 · 128 citations
- Enhancing Chat Language Models by Scaling High-quality Instructional ConversationsNing Ding, Yulin Chen, Bokai Xu, Yujia Qin et al.EMNLP 2023 · 95 citations
- Privacy Side Channels in Machine Learning SystemsEdoardo Debenedetti, Giorgio Severi, Milad Nasr, Christopher A. Choquette-Choo et al.USENIX Security 2024 · 52 citations
- Reverse-Engineering Deep Neural Networks Using Floating-Point Timing Side-ChannelsCheng Gongye, Yunsi Fei, Thomas WahlDAC 2020 · 39 citations
Related papers
- From Length to Content: Token-Length Side-Channel Attacks on LLM API Merged OutputsSijia Li, Tianyu Cui, Miao Chen, Xinjie Lin et al.USENIX Security 2026
- Reconstruct Your Previous Conversations! Comprehensively Investigating Privacy Leakage Risks in Conversations with GPT ModelsJunjie Chu, Zeyang Sha, Michael Backes, Yang ZhangEMNLP 2024 · 3 citations
- Combing for Credentials: Active Pattern Extraction from Smart ReplyBargav Jayaraman, Esha Ghosh, Melissa Chase, Sambuddha Roy et al.S&P 2024 · 11 citations
- I Know What You Asked: Prompt Leakage via KV-Cache Sharing in Multi-Tenant LLM ServingGuanlong Wu, Zheng Zhang, Yao Zhang, Weili Wang et al.NDSS 2025
- When AI Meets the Web: Prompt Injection Risks in Third-Party AI Chatbot PluginsYigitcan Kaya, Anton Landerer, Stijn Pletinckx, Michelle Zimmermann et al.S&P 2026 · 12 citations
