A simple demonstration of Server-Side Template Injection (SSTI) using the Flask web framework.
Server-Side Template Injection (SSTI) is a web vulnerability where attackers can inject malicious input into server-side templates. These templates are rendered on the server before being sent to the user, and if improperly handled, they can allow attackers to execute arbitrary code β even enabling Remote Code Execution (RCE).
This project emulates an SSTI scenario in a controlled environment to help developers understand and test this class of vulnerability.
git clone https://github.com/SusmoyNath/CyberSecurity-Server_Side_Template_Injection.git
cd CyberSecurity-Server_Side_Template_InjectionMake sure Python 3 and pip are installed.
pip3 install Flask
pip3 install virtualenvmkdir SSTIProject
cd SSTIProject
python3 -m venv venv
source venv/bin/activatemkdir SSTIProject
cd SSTIProject
python -m venv venv
venv\Scripts\activateexport FLASK_APP=hello.pyset FLASK_APP=hello.pyflask runVisit http://127.0.0.1:5000/ in your browser to interact with the demo.
This project is for educational purposes only. Do not deploy this code in production. The goal is to understand and prevent such vulnerabilities, not exploit them.
If you're exploring web security or working in DevSecOps, understanding SSTI is crucial. Use this demo to test, learn, and level up your security awareness!