Skip to content
AI / LLM Write-up Intermediate

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.

nilanjan.calculus Follow

Published on medium.com

Author : Nilanjan Chowdhury

Nilanjan Chowdhury, on medium.com

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

  1. Enumerate the chatbot's exposed APIs and find one that accepts raw SQL.
  2. Ask the chatbot to run a SQL statement that deletes the target user.
  3. Test command execution through an API by sending a shell substitution.
  4. Use the chatbot to run a command that deletes a target file.
  5. Place a prompt-injection payload in a product review so the chatbot deletes the reviewer's account.
  6. 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.

More by nilanjan.calculus

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

AI and LLM vulnerabilities

The lesson behind this report.

Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.