I Didn’t Hack the App. I Hacked the AI. Web LLM is breached !
The author completed five PortSwigger Web LLM labs where an AI assistant had excessive agency, unsafe output handling, or network access. By injecting instructions through chat or product reviews, the assistant could be made to run SQL or shell commands, render XSS, or trigger SSRF to delete a target account.
Published on medium.com
Author : Nilanjan Chowdhury
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 assistant was given excessive agency and treated untrusted user or review content as instructions, without safely handling its output or restricting its network access.
Impact
An attacker could delete other users' accounts, run database or shell commands, execute XSS in a victim's browser, and reach internal administrative services through SSRF.
What the attacker needed
Access to the chatbot; ability to post product reviews; victim queries the poisoned product
The fix
The application should not give the AI assistant excessive agency, should treat retrieved content as untrusted, should safely encode LLM output, and should restrict the AI agent's network access.
How it was found
- Enumerate the chatbot's exposed APIs and find one that accepts raw SQL.
- Ask the chatbot to run a SQL statement that deletes the target user.
- Test command execution through an API by sending a shell substitution.
- Use the chatbot to run a command that deletes a target file.
- Place a prompt-injection payload in a product review so the chatbot deletes the reviewer's account.
- Move the review to a product the victim will query so the chatbot deletes the victim's account.
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.
An AI chatbot was given powerful tools, such as the ability to run database queries or commands, and it trusted text from users and product reviews. Attackers could hide instructions in that text so the chatbot carried them out, for example deleting another user's account or running a harmful script in a browser.
What is AI / LLM?
Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.