Twig PHP less than 2.4.4 template engine - SSTI

Anandhu K A
Published on
01 Oct 2021

Twig is a modern PHP template engine that compiles templates down to plain optimised PHP code. Twig 2.4.4 has an SSTI vulnerability that allows attackers to execute commands within parameters. By just using "COMAND TO EXECUTE" instead of expected values “Normal integer or normal string,” depending on the vulnerable application, which uses GET or POST to pass different parameters.

Mitigation / Precaution

This issue was fixed in version 2.4.4. However, as this version is vulnerable to other flaws, we recommend that you switch to one of the secure versions.

Automated human-like penetration testing for your web apps & APIs
Teams using Beagle Security are set up in minutes, embrace release-based CI/CD security testing and save up to 65% with timely remediation of vulnerabilities. Sign up for a free account to see what it can do for you.

Written by
Anandhu K A
Anandhu K A
Lead Engineer
Find website security issues in a flash
Improve your website's security posture with proactive vulnerability detection.
Free website security assessment