ssti-analysis
Skill17 starsChanged 47 days agoMITView on GitHub
Analyze server-side template injection risks — use when user input reaches template engines (Jinja, Twig, Freemarker, Pug, Liquid) or dynamic template compile/render APIs (CWE-1336 / A03:2021).
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
After AXguard hits ssti.*.
- Very specific: line 58
Read secrets/env/config through template object graphs.
- Distinctive: line 66
Check sandbox / restricted environments — note they are often escapable.
- Distinctive: line 69
Prefer static confirmation of taint → compile/render over speculative payload design.
- Distinctive: line 87
Never compile templates from untrusted strings.
- Distinctive: line 88
If user-defined templates are required: strict sandbox, allowlisted tags/filters, separate least-privilege worker, no access to OS/app …
- Distinctive: line 89
Prefer non-Turing template languages or logic-less templates for tenant customization.
- Distinctive: line 90
Keep engines patched; disable dangerous extensions/plugins.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SSTI Analysis
Purpose
Encode practitioner reasoning for Server-Side Template Injection (SSTI): attacker-influenced strings are evaluated as template code by the server template engine, often escalating to RCE or data disclosure.
When to Use / When Not to Use
Use when:
- Code calls
render_template_string,Template(user),compile(, Pug/_.template, Twig string templates, FreemarkerStringTemplateLoader, Liquid parse of user content. - After AXguard hits
ssti.*. - Features like “custom email templates”, “report builders”, or “theme editors” accept template syntax from users.
Do not use when:
- Templates are static files and user data is passed only as variables into a fixed template (normal MVC rendering).
- Client-side-only template libs with no server evaluation (consider XSS instead).
Security Concepts
SSTI is not “XSS on the server.” The engine parses and executes template language constructs ({{ }}, {% %}, expressions). Passing user input as data into a precompiled template is usually safe; building or compiling a template from user input is not.
Threat Model
Attacker goals:
- Remote code execution via template sandbox escapes.
- Read secrets/env/config through template object graphs.
- Bypass auth by evaluating expressions in privileged render paths.
Analysis Workflow
- Inventory template engines and versions (Jinja2, Mako, Twig, Freemarker, Velocity, Pug, EJS, Liquid).
- Find dynamic compile/render APIs vs static template + context dict.
- Trace whether any request/DB/AI field becomes the template source string.
- Check sandbox / restricted environments — note they are often escapable; do not treat “sandbox=True” as automatic safe.
- Distinguish design: admin-only template editors vs any-user input.
- Assess impact by engine capabilities (file read, subprocess, class loading).
- Prefer static confirmation of taint → compile/render over speculative payload design.
Evidence Requirements
- File:line of template compile/render sink
- Attacker-controlled template source (not merely variables)
- Missing isolation (no sandbox / weak sandbox / privileged process)
- Impact class (RCE / file read / info disclosure) as hypothesis until validated
False Positive Controls
- Fixed template path + user values only in context
- Template names selected from server allowlist (not raw body)
- Offline build-time templates with no runtime string compile
- Intentional SSTI unit fixtures
Remediation
- Never compile templates from untrusted strings; pass data as variables only.
- If user-defined templates are required: strict sandbox, allowlisted tags/filters, separate least-privilege worker, no access to OS/app objects.
- Prefer non-Turing template languages or logic-less templates for tenant customization.
- Keep engines patched; disable dangerous extensions/plugins.
Verification
Detect dynamic template APIs → Remove user-as-template → Re-run axguard → Confirm only variable substitution remainsRelated Skills
command-injection— common SSTI escalation classxss-analysis— if output is HTML without server evaluationsecurity-triage,security-remediation
Framework Mapping
- CWE-1336
- OWASP Top 10 2021 A03:2021 Injection
References
Research Provenance
Primary sources:
- OWASP Top 10:2021 A03 (accessed 2026-09-15)
- CWE-1336 (accessed 2026-09-15)
Secondary / internal:
- AXGuard
rules/ssti.json,/axguard-ssti - AwareXone Agentic-Bug-Hunter SSTI methodology (concepts only; not copied)
Datasets:
- UVID HF dataset — category linkage concepts only (MIT license metadata review 2026-09-15)
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-agent-securitySkill
- ai-application-securitySkill
- api-securitySkill
- attack-surface-mappingSkill
- authentication-analysisSkill
- authorization-analysisSkill
- axguard-auditSkill
- axguard-csoSkill
- axguard-knowledgeSkill
- axguard-preshipSkill
- axguard-remediateSkill
- axguard-reportSkill
- axguard-securitySkill
- axguard-triageSkill
- cloud-securitySkill
- command-injectionSkill
- configuration-securitySkill
- deserialization-securitySkill
- file-upload-securitySkill
- graphql-securitySkill
- jwt-securitySkill
- mcp-securitySkill
- oauth-securitySkill
- path-traversalSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- secrets-detectionSkill
- security-architecture-reviewSkill
- security-remediationSkill
- security-triageSkill
- session-securitySkill
- sql-injectionSkill
- ssrf-analysisSkill
- supply-chain-securitySkill
- threat-modelingSkill
- websocket-securitySkill
- xss-analysisSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

