<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: hunting-template-injection
description: >-
  Hunt for Server-Side Template Injection (SSTI) and Client-Side Template Injection (CSTI) vulnerabilities across Jinja2, Twig, Freemarker, and JavaScript template engines.
domain: cybersecurity
subdomain: bug-bounty
tags:
  - ssti
  - csti
  - template-engine
  - rce
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1190"]
  frameworks: ["MITRE ATT&CK", "OWASP"]
  tools: ["burpsuite", "tplmap", "semgrep"]
---

# Hunting Template Injection

## Overview

Hunt for Server-Side Template Injection (SSTI) and Client-Side Template Injection (CSTI) vulnerabilities across Jinja2, Twig, Freemarker, and JavaScript template engines.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `burpsuite` | Security tooling |
| `tplmap` | Security tooling |
| `semgrep` | Security tooling |
| Burp Suite, tplmap, understanding of template engine syntax | Environment requirement |

## Quick Reference

```bash
# Quick start commands
node scripts/agent.js --help
node scripts/agent.js identify --url https://target.com --param name
```

## Workflow

### Step 1: Identify Template Engine

```bash
node scripts/agent.js identify --url https://target.com --param name
```

### Step 2: Test SSTI Payloads

```bash
node scripts/agent.js test --url https://target.com --param name --engine jinja2
```

### Step 3: Escalate to RCE

```bash
node scripts/agent.js exploit --url https://target.com --param name --engine jinja2
```


## Verification

- **Verify engine detection**: `node scripts/agent.js identify --url https://target.com --param name`
- **Confirm SSTI**: `node scripts/agent.js test --url https://target.com --param name --engine jinja2`

## References

- MITRE ATT&CK: T1190
- Frameworks: MITRE ATT&CK, OWASP
- Tools: burpsuite, tplmap, semgrep
