Lab: Basic server-side template injection
Summary: PortSwigger's lab demonstrates server-side template injection caused by the unsafe construction of an ERB template. Solving it requires using ERB template syntax to run arbitrary code and delete the morale.txt file from Carlos's home directory.
Bottom line: An ERB template built from user input turns a message parameter into arbitrary code execution, and in this lab that is enough to delete a file from a user's home directory.
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