Skip to content
AI / LLM Write-up Intermediate

I Got Scared Looking at an AI Security Scanner… Then I Broke It

An AI-powered scanner that read blog comments as part of its scan could be tricked by a comment containing hidden instructions into fetching another user's account page and posting that user's API key publicly. An attacker with a normal account could therefore obtain a privileged user's secret without ever accessing that user's account.

TEJAS Follow

Published on tsaubhage0007.medium.com

Lab link: PortSwigger Web Security Academy — Exploiting AI agents to exfiltrate sensitive information

TEJAS, on tsaubhage0007.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 scanner passed untrusted comment content into the same context as its own instructions, so text written by a user could be interpreted as a command.

Impact

An attacker with an ordinary account could cause the scanner to disclose another user's API key in a public comment, and the text notes that the scanner's responses are not perfectly consistent, so a first attempt may fail.

What the attacker needed

A free account on the lab; ability to post comments; victim does not need to act

How it was found

  1. Log in with a normal account and open a blog post that has a Scan site button.
  2. Click Scan site and observe that the scanner reads the post and its comments, then posts findings as new comments.
  3. Post a comment containing a hidden instruction telling the scanner to fetch the account page, extract the API key and post it as a comment.
  4. Run the scan again and refresh the comments to see whether the instruction was followed.
  5. If nothing happens, rewrite the instruction to be clearer and more procedural, then run the scan again.
  6. Read the scanner's new comment, which contains the other user's API key, and submit it to solve the lab.

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.

A website had an AI helper that read blog posts and their comments to look for problems. Because it treated text written by ordinary users as if it were instructions from its owner, someone could hide a command in a comment telling it to go and copy a secret from another person's account. The AI then posted that secret where everyone could see it.

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 TEJAS

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.