How I Discovered SSTI Vulnerability in Just 5 Minutes | $300 Bounty
The website rendered user-supplied profile data inside server-side templates without sanitisation, so a first name containing a template expression was evaluated when a password reset email was generated. An attacker could inject template expressions that execute on the server, potentially leading to code execution or data exposure.
Published on medium.com
I’m Abhijeet Kumawat, a passionate security researcher 🕵️♂️, and today, I’m excited to share a recent vulnerability. This is the story of how I discovered a Server-Side Template Injection (SSTI) vulnerability 🔒in self-hosted website — and earned a $300 bounty in the process.Here’s how it happened.👇
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
The server evaluated attacker-controlled template expressions, which could lead to arbitrary code execution, data leakage, or full system compromise.
What the attacker needed
A free account on the website; ability to edit profile details; access to the email inbox for password reset
The fix
The application should validate and escape user input before rendering it in templates, and avoid template engines that allow code execution.
How it was found
- Create an account on the self-hosted website and log in.
- Go to the Profile section and change the First Name to a template expression.
- Save the changes and note that the update succeeds without validation.
- Log out and request a password reset for the account's email address.
- Open the reset email and observe that the template expression has been evaluated in the greeting.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A template is a page blueprint that a server fills in with data, such as a name in an email. If the server treats the name as part of the blueprint instead of plain text, it will run any instructions hidden in the name. Here, a simple maths expression in the first name was calculated by the server, proving that an attacker could slip in more dangerous instructions.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.