Cyber security

TInjA – The Template INJection Analyzer

TInjA is a powerful CLI tool designed to detect and identify template injection vulnerabilities in web applications.

Developed by Hackmanit and Maximilian Hildebrand, it supports 44 of the most relevant template engines across eight programming languages, including Python, Java, JavaScript, and more.

Key Features

  • Automatic Detection and Identification: TInjA automatically detects template injection possibilities and identifies the template engine in use. It supports both server-side template injection (SSTI) and client-side template injection (CSTI) vulnerabilities.
  • Efficient Scanning: The tool uses polyglots to efficiently scan web pages. On average, only five polyglots are needed to detect vulnerabilities and identify the template engine.
  • Customization Options: Users can specify custom headers, cookies, POST parameters, and query parameters for the scan. It also allows routing traffic through a proxy and configuring ratelimiting to manage the number of requests per second.
  • Reporting and Output: TInjA can generate reports in JSONL format, providing detailed insights into the scan results. This feature is useful for tracking and analyzing vulnerabilities across multiple URLs.

TInjA supports a wide range of template engines across different programming languages:

  • .NET: DotLiquid, Fluid, Razor Engine, Scriban
  • Elixir: EEx
  • Go: html/template, text/template
  • Java: Freemarker, Groovy, Thymeleaf, Velocity
  • JavaScript: Angular.js, Dot, EJS, Eta, Handlebars, Hogan.js, Mustache, Nunjucks, Pug, Twig.js, Underscore, Velocity.js, Vue.js
  • PHP: Blade, Latte, Mustache.php, Smarty, Twig
  • Python: Chameleon, Cheetah3, Django, Jinja2, Mako, Pystache, SimpleTemplate Engine, Tornado
  • Ruby: ERB, Erubi, Erubis, Haml, Liquid, Mustache, Slim

TInjA can be installed using prebuilt binaries or by compiling it with Go (version 1.21 or higher). The tool offers flexible usage options, including scanning single URLs, multiple URLs, or URLs provided in a file.

It also supports passing raw HTTP requests and JSONL files for more complex scenarios. TInjA was developed as part of a master’s thesis by Maximilian Hildebrand.

It is part of a broader project that includes the Template Injection Table and the Template Injection Playground, which provide additional resources for understanding and testing template injection vulnerabilities.

TInjA is licensed under the Apache License, Version 2.0, making it freely available for use and modification.

Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Shebang (#!) in Bash Script

When you write a Bash script in Linux, you want it to run correctly every…

7 hours ago

Bash String Concatenation – Bash Scripting

Introduction If you’re new to Bash scripting, one of the first skills you’ll need is…

11 hours ago

Learn Bash Scripting: How to Create and Run Shell Scripts for Beginners

What is Bash Scripting? Bash scripting allows you to save multiple Linux commands in a file and…

1 day ago

Bash if…else Statement – Bash Scripting

When it comes to automating tasks on Linux, Bash scripting is an essential skill for both beginners…

1 day ago

Bash Functions Explained: Syntax, Examples, and Best Practices

Learn how to create and use Bash functions with this complete tutorial. Includes syntax, arguments,…

4 days ago

50+ Essential Linux Commands for Beginners and Experts: A Complete Guide

Introduction Unlock the full potential of your Linux system with this comprehensive guide to essential…

3 weeks ago