CVE-2022-29221 affects Smarty, a PHP template engine. In Smarty versions prior to 3.1.45 and 4.1.1, a template author can inject PHP code by supplying a malicious {block} name or {include} file name. The issue arises from insufficient neutralization of attacker-controlled input used in template constructs, allowing crafted template content to be transformed into executable PHP in the generated template output. This is particularly relevant in deployments where template authors are not fully trusted.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.
This repository is a Proof-of-Concept (PoC) for CVE-2022-29221, a code injection vulnerability in the Smarty PHP template engine (version 4.1.0 and earlier). The repository contains a minimal PHP application (index.php) that loads a single template (template/index.tpl) using Smarty. The template demonstrates the exploit by injecting PHP code into the block name, which results in arbitrary command execution (e.g., 'whoami') on the server. The exploit works by leveraging the vulnerability where Smarty fails to properly sanitize block names, allowing attackers to inject PHP code. The PoC shows that after rendering the template, a new PHP file is created in the './compile/' directory, containing the injected code. The repository structure is simple, with directories for cache, compile, config, and template, and uses Composer to install the vulnerable Smarty version. No network endpoints are present; the attack vector is local, requiring the attacker to provide a malicious template. The exploit is a clear demonstration of the vulnerability and is not weaponized, serving as a basic PoC.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
No public activity tracked yet. Mallory keeps watching.
No public activity observed for this vulnerability.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.