hunt-ssti

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

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/inventashif/helpful-code-sidekick --skill hunt-ssti-inventashif
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hunt-ssti
Source: https://github.com/inventashif/helpful-code-sidekick/tree/main/scripts/hackerai/skills/bughunter/hunt-ssti
Command: npx skills add https://github.com/inventashif/helpful-code-sidekick --skill hunt-ssti-inventashif

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Server-side template injection is easy to miss and often under-reported: arithmetic probes can fail silently, the wrong engine syntax wastes time, and testers stop at detection instead of proving RCE impact. This Skill provides a structured methodology to fingerprint the template engine, escalate to remote code execution, and avoid common false negatives during bug bounty hunting. ## Core Features & Use Cases - Engine Fingerprinting Matrix: Differentiate Jinja2, Twig, Freemarker, Velocity, ERB, Thymeleaf, and Mako using math-expression probes like {{77}}, ${77}, and {{7*'7'}}. - RCE Escalation Payloads: Engine-specific exploitation patterns including the Jinja2 class-walker via config.class.init.globals, Twig registerUndefinedFilterCallback, and the Freemarker Execute utility. - Edge-Case Handling: Guidance for length-constrained fields, authenticated CMS template editors with CSRF tokens and preview actions, form-encoded vs JSON body pitfalls, and email-based reflected sinks. - Use Case: While testing a target's profile-name field, you confirm Jinja2 injection with a short probe, enumerate the subclass index in stages to fit the length limit, and read the command output from the outbound confirmation email to prove RCE for a report. ## Quick Start Test the target's name field for SSTI by sending {{7*7}} and escalating to the Jinja2 os.popen payload if it evaluates to 49.

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?

Send math-expression probes like {{7*7}}, ${7*7}, <%= 7*7 %>, and *{7*7} to injectable fields and check whether the response contains 49. The syntax that evaluates reveals the engine family, and {{7*'7'}} differentiates Jinja2 (7777777) from Twig (49).

How to escalate SSTI to remote code execution in Jinja2?

Use the class-walker payload {{config.__class__.__init__.__globals__['os'].popen('id').read()}} against Flask or Django targets. Command output such as uid=N(user) in the response confirms RCE regardless of the HTML context it appears in.

Why does my SSTI payload return nothing even though injection exists?

Arithmetic detection fails silently when input is echoed inside HTML attributes, and JSON bodies are ignored by form-processing endpoints expecting application/x-www-form-urlencoded data. Also verify the engine first, since {{7*7}} does nothing on Freemarker, which requires ${7*7} syntax.

Can SSTI work in length-limited fields like profile names?

Yes, use short probes like {{'7'*7}} for detection, then enumerate the class index in stages with [].__class__.__base__.__subclasses__() instead of one long payload. The evaluated output often appears in outbound confirmation emails rather than the web page.

What is the difference between sandboxed SSTI and full RCE for severity?

A {{7*7}} reflection inside a sandboxed engine such as Twig sandbox mode or Jinja2 SandboxedEnvironment is Medium severity, not Critical RCE. Prove impact with actual command execution or an out-of-band DNS callback using a unique marker before claiming Critical.