Cyber Risks · PortSwigger Research

Lab: Exploiting vulnerabilities in LLM APIs

Summary: PortSwigger's Web LLM attacks lab presents a live LLM whose accessible APIs include a Newsletter Subscription function, and asking it to call that API with the argument $(whoami)@... caused the resulting email to be sent to carlos@..., indicating the whoami command executed. Calling the same API with $(rm /home/carlos/morale.txt)@... then deleted the morale.txt file from Carlos' home directory, solving the lab.

Why it matters: An LLM wired to backend APIs will pass along whatever arguments a user supplies, so a single prompt turned an email subscription field into OS command execution and file deletion on the host.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related