Server Side Template Injection (SSTI)
Summary
SSTI allows an attacker to inject malicious code into server-side templates, leading to potential remote code execution, data leakage, or server compromise.
Testing methodology
Description
Server Side Template Injection (SSTI) is a vulnerability that arises when user-controlled input is processed and rendered within server-side templates without proper validation. Attackers can exploit this vulnerability to inject malicious code into the template, which is then executed on the server-side, leading to potential remote code execution, data leakage, or even full server compromise.
Remediations
- Avoid direct evaluation or rendering of user-controlled input within server-side templates.
- Implement strict input validation and sanitization of user-controlled input.
- Use context-specific output encoding or escaping when injecting user input into templates.
- Use template engines or frameworks with built-in protections against SSTI vulnerabilities.
Affected components
- Server