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
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026