Skip to content
AI / LLM Write-up Intermediate

Exploiting Generative Ai Apps With Prompt Injection

A custom AI chatbot built on Azure OpenAI was configured with default settings and no content filters, allowing a user to extract protected medical records through basic prompts and a text completion exploitation technique. The attacker could obtain confidential information that the chatbot was supposed to keep private.

grepStrength Follow

Published on infosecwriteups.com

Certifications only go so far, so when I recently picked up AI-900, my immediate thought was “How do I show that actually learnedanything?” This led me to want to blog about building a generative AI solution. Generative AI, and various other AI tools, can be fantastic resources to boost productivity in software…

grepStrength, on infosecwriteups.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 chatbot was deployed with default configurations, no content filters, and insufficient restrictions on what information it could output, allowing users to bypass intended confidentiality rules.

What the attacker needed

Access to the chatbot web app; chatbot has uploaded sensitive documents; default or weak content filters

The fix

The chatbot should be configured with content filters, custom instructions, and other controls to prevent leakage of protected data, and the application itself must be secured, not just the network.

How it was found

  1. Create an Azure OpenAI resource and deploy a model (gpt-35-turbo-16k).
  2. Upload fake invoices and medical records to the chatbot's data store.
  3. Deploy the chatbot as a web app with default settings.
  4. Ask basic questions to enumerate uploaded documents and retrieve medical records.
  5. Add custom instructions to prevent leakage, then use a text completion prompt to bypass them.
  6. Successfully extract protected radiology report content.

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 is about an AI chatbot that was given private documents to answer questions. The chatbot was not properly locked down, so someone could trick it into revealing those private documents by asking clever questions or starting a sentence in a way that made the AI continue with secret information. This is called prompt injection, which is like social engineering for AI.

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 grepStrength

View all

5 more disclosed reports, 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.