php-tpl-audit

Trace user input through PHP template rendering to identify SSTI risks.

386|38|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/0xShe/PHP-Code-Audit-Skill --skill php-tpl-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-tpl-audit
Source: https://github.com/0xShe/PHP-Code-Audit-Skill/tree/main/php-tpl-audit
Command: npx skills add https://github.com/0xShe/PHP-Code-Audit-Skill --skill php-tpl-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyzes PHP source code to identify template injection (SSTI) risks and dangerous expression execution flows, tracing user-controlled content from input to render/compile and potential code execution to enable safe remediation.

Core Features & Use Cases

  • Detects template rendering points in Twig, Laravel Blade, Smarty, and custom engines.
  • Traces data flow from user input to rendering and evaluation, exposing controllable templates and execution chains.
  • Generates actionable reports with evidence, remediation suggestions, and PoC guidance for audits.

Quick Start

Run the tpl-audit tool against your PHP project to locate SSTI risks and generate a remediation report.

Frequently Asked Questions about php-tpl-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect PHP SSTI vulnerabilities in Twig or Laravel Blade templates?

PHP SSTI vulnerabilities are detected by tracing user input through template rendering and expression evaluation to map controllable templates, render paths, and execution chains across Twig, Blade, Smarty, or custom engines.

How do I trace user input to template rendering paths in PHP source code?

Tracing user input to template rendering paths requires analyzing PHP source code to follow data flow from entry points to render and compile functions, exposing controllable templates and execution chains with evidence.

What is needed to perform a template injection security audit on a PHP application?

A template injection security audit requires a trace output from the php-route-tracer containing sink evidence, controllability, and trace integrity, which is then applied to generate PoC frameworks and remediation guidance.

Does this PHP template audit tool support custom template engines?

Yes, the audit tool supports custom template engines alongside Twig, Laravel Blade, and Smarty by identifying template rendering points and dangerous expression execution flows across these environments.

What is the best way to generate a PoC for PHP template injection risks?

The best way to generate a PoC for PHP template injection risks is to analyze traced data flow from user input to render and compile paths, producing a PoC framework and remediation guidance based on execution chains.

Why does PHP template injection lead to remote code execution?

PHP template injection leads to remote code execution when user-controlled content reaches template rendering and expression evaluation functions, exposing dangerous compile and execution chains through data flow tracing.