Amazon Q Developer: Secrets Leaked via DNS and Prompt Injection
The Amazon Q Developer VS Code extension could be tricked by untrusted data into leaking sensitive information such as API keys from a developer's machine to external servers through DNS requests. An attacker could also use indirect prompt injection to trigger this behaviour.
embracethered.com
Published on embracethered.com
The next three posts will cover high severity vulnerabilities in the Amazon Q Developer VS Code Extension (Amazon Q Developer), which is a very popular coding agent, with over 1 million downloads.
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 extension passed untrusted content to the language model without isolating it from sensitive local data, so model behaviour alone decided whether secrets were sent out.
Impact
Sensitive information such as API keys could be leaked from a developer's machine to external servers, and an adversary could trigger this during an indirect prompt injection attack.
What the attacker needed
Amazon Q Developer extension installed; untrusted content reaches the agent
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 coding assistant extension can be fed hidden instructions inside ordinary content it reads, and it may then follow those instructions instead of its intended job. Here that meant it could send private data, like passwords or API keys, out to a server the attacker controls, hidden inside DNS lookups, which are the internet's address book queries. The extension's safety relied on the AI model behaving well, which is not a reliable defence.
What is AI / LLM?
Prompt injection, data exfiltration and tool abuse in features built on language models, and the ordinary bugs around them.