Cyber Risks · PortSwigger Research

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