Lab: Server-side template injection in a sandboxed environment
Summary: This PortSwigger lab uses the Freemarker template engine, which is vulnerable to server-side template injection because of its poorly implemented sandbox. Solving the lab requires breaking out of the sandbox to read the file my_password.txt from Carlos's home directory and submitting its contents.
What's compelling: A template engine sandbox is a control, and this lab shows it failing: once an attacker chains method invocations to reach a class with a static file-reading method, files like my_password.txt on the host are readable.
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