# Server-side template injection (SSTI)

Lower-trust data becomes executable template source at a server-side renderer.

**Candidate CWE:** [CWE-1336](https://cwe.mitre.org/data/definitions/1336.html)

## Test hypothesis

At a source-confirmed local template sink, compare a literal marker with two arithmetic expressions producing distinct values. Read raw HTTP output before browser scripts execute and inspect the renderer call.

## Evidence required

Server-side evaluation violates the field’s text-only or sandbox contract. State the demonstrated capability; arithmetic supports expression evaluation and does not by itself prove OS execution.

## Rule out false positives

A supported template editor, client-side computation, one coincidental arithmetic result, or escaped expression text is insufficient.

## Playbook and command references

- [Trace input into queries, commands, and templates](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/injection-tracing.html) — Prove interpretation at a specific sink using small paired experiments instead of payload spraying.

[Find the associated command snippets](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/commands.html?q=Trace%20input%20into%20queries%2C%20commands%2C%20and%20templates)

## Referenced by these target playbooks

[Web & API](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/web-api.html) · [OSS & self-hosted](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/oss.html) · [AI, agents & MCP](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/ai.html) · [Desktop & extensions](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/desktop.html)

## Report checklist

- [ ] Capture the affected version, configuration, identities, and object ownership.
- [ ] Preserve a valid baseline and a negative control.
- [ ] Reproduce the forbidden data access, action, or state change on controlled fixtures.
- [ ] Explain the intended security rule and why the observed behavior violates it.
- [ ] State prerequisites, uncertainty, cleanup, and the smallest demonstrated impact.

## Conditional ATT&CK mapping

- [T1190 · Exploit Public-Facing Application](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/attack.html#T1190) — **Only if:** A demonstrated exploit of an Internet-facing service provides initial access to its host, system, or environment; explain the foothold and trust boundary. **Not established by:** Not a blanket label for every web/API weakness. A reflected parameter, scanner alert, or ordinary cross-account object read alone does not establish initial network/system access.

## Primary references

- [PortSwigger template injection](https://portswigger.net/web-security/server-side-template-injection)

[Back to the complete vulnerability catalog](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities.html)
