hunt-ssti

Detects and exploits server-side template injection across Jinja2, Twig, Freemarker, ERB, and other engines.

Updated May 29, 2026
One-click install
npx skills add https://github.com/hhjkjkjk/Claude-skills --skill hunt-ssti-hhjkjkjk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hunt-ssti
Source: https://github.com/hhjkjkjk/Claude-skills/tree/main/skills/hunt-ssti
Command: npx skills add https://github.com/hhjkjkjk/Claude-skills --skill hunt-ssti-hhjkjkjk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Server-side template injection is a high-impact vulnerability class that often leads directly to remote code execution, yet it is frequently missed because each template engine uses different syntax and exploitation primitives. This Skill provides the detection probes, engine fingerprinting logic, and engine-specific RCE escalation paths needed to find and validate SSTI during authorized security testing. ## Core Features & Use Cases - Multi-Engine Detection Probes: Math-expression payloads ({{77}}, ${77}, <%= 77 %>, #{77}, {77}) that fingerprint Jinja2, Twig, Freemarker, Velocity, ERB, Mako, Thymeleaf, Smarty, and Spring based on server-evaluated output. - Engine-Specific RCE Escalation: Class-walker payloads for Jinja2, registerUndefinedFilterCallback for Twig, backtick execution for ERB, and Execute-utility patterns for Freemarker and Velocity. - Injection Surface Guidance: Identifies high-yield test points including email templates, PDF/report generators, CMS preview features, invoice fields, and reflected URL parameters. - Use Case: During a bug bounty engagement, you notice a user's display name is reflected in a rendered email template. You submit {{77}}, observe 49 in the output, fingerprint the engine as Jinja2 with {{7'7'}}, then escalate to command execution and confirm with an out-of-band callback before reporting. ## Quick Start Test the name field of the target's email template feature with SSTI detection payloads and escalate to RCE if an engine is fingerprinted.

Frequently Asked Questions about hunt-ssti

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect server-side template injection in a web application?▼

Submit math expressions in template syntax such as {{7*7}}, ${7*7}, <%= 7*7 %>, and #{7*7} into user-controlled fields. If the server returns the evaluated result (49) instead of the literal string, the input is being rendered by a template engine and is injectable.

How do I identify which template engine is behind an SSTI vulnerability?▼

Use engine-differentiating probes: {{7*7}} evaluating to 49 indicates Jinja2 or Twig, while {{7*'7'}} returning 7777777 confirms Jinja2 specifically. ${7*7} points to Freemarker or Velocity, <%= 7*7 %> to ERB, and *{7*7} to Spring Thymeleaf.

How do I escalate Jinja2 SSTI to remote code execution?▼

Use the class-walker payload {{config.__class__.__init__.__globals__['os'].popen('id').read()}} to reach the os module through Python's object hierarchy. Confirm execution with a unique marker or out-of-band DNS callback before claiming RCE in a report.

Where should I test for SSTI vulnerabilities in web apps?▼

Prioritize features that compose strings with user input before rendering: email templates, PDF and report generators, invoice name fields, CMS preview functions, error pages reflecting input, and uploaded documents like DOCX files that the server re-renders.

Why does {{7*7}} return 49 but RCE payloads fail?▼

The engine is likely running in a sandboxed mode, such as Twig sandbox or Jinja2 SandboxedEnvironment, which evaluates expressions but blocks access to dangerous classes and functions. This is exploitable as Medium-severity SSTI or stored XSS, not Critical RCE.

Can SSTI lead to SSRF instead of RCE?▼

Yes. Template engines often expose URL fetchers or include functions before exposing the runtime. For example, Twig's {{ include('http://169.254.169.254/...') }} can fetch AWS metadata credentials, giving SSRF and cloud credential theft as an alternative impact path.