I bypassed Guardrails to Perform Prompt Injection
The application appended user profile fields (such as username and address) and stored chat history to the LLM prompt without passing them through the input guardrails. An attacker could therefore inject malicious instructions via those fields or via previously stored messages, bypassing the guardrails and causing the model to follow the attacker's instructions.
osintteam.blog
Published on osintteam.blog
Hi everyone, in this article, I’ll walk you through an AI/LLM security assessment that I conducted some time ago.
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 application concatenated user-controlled data from the database (profile fields and chat history) into the LLM prompt without applying the same guardrail checks used for direct user input.
Impact
An attacker could bypass the guardrails and make the LLM follow injected instructions, potentially causing it to reveal or act on unintended information.
What the attacker needed
A free account; ability to set profile fields; access to the chatbot
How it was found
- Create an account with malicious prompts in the username, address, and other profile fields.
- Ask the chatbot a normal question that causes it to include the profile fields in the prompt.
- Observe that the malicious prompt in the profile fields is processed by the LLM.
- Submit a malicious prompt directly to the chatbot so it is blocked and saved as chat history.
- Ask the chatbot to process all previous messages, including the stored malicious prompt.
- Observe that the stored prompt bypasses the guardrails and is executed.
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 supposed to ignore harmful instructions. The system checked what you typed in the chat box, but it forgot to check other information it added to the conversation, like your username or old messages. By putting bad instructions in those unchecked places, the attacker made the AI do things it was not supposed to.
What is AI / LLM?
Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.