Deepseek Ai In Chat Unveils The Risks Of Prompt Injection To Account Takeover
The author claims that Deepseek AI's chat interface processes uploaded files and renders their content, allowing an attacker to embed a prompt injection that causes the AI to output an iframe with a JavaScript URL. This could execute script in the user's browser, stealing the session token from localStorage and cookies, potentially leading to account takeover.
Published on infosecwriteups.com
I am Adesh Kolte, an Offensive Security Engineer specializing in both Web2 and Web3 ecosystems. One morning, as part of my routine exploration of AI security, I began experimenting with Deepseek AI to assess its capabilities and found something interesting.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the AI chat interface renders user-supplied content (including AI-generated output) without sanitising it, allowing JavaScript execution via an iframe with a javascript: URL.
Impact
The JavaScript could retrieve the user's session token from localStorage and cookies, and if an attacker obtains this token, it could allow account takeover.
What the attacker needed
Victim uploads a malicious file; victim asks AI to show file content; AI renders unsanitised output
How it was found
- Create a text file containing a Base64-encoded XSS payload that decodes to an iframe with a javascript: URL.
- Go to Deepseek AI's chat interface and upload the file.
- Ask Deepseek AI to show the content of the uploaded file.
- If Deepseek AI executes the prompt, it renders the JavaScript, causing XSS execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This report suggests that an AI chat tool might display content from uploaded files without proper safety checks. An attacker could craft a file that tricks the AI into showing a malicious link or script. If a user then views that content, the script could run in their browser and steal their login token, letting the attacker take over their account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.