CVE-2021-21408 Access to restricted PHP code by dynamic static class access in smarty

High 8.8 Published Updated

Template authors can execute restricted static PHP methods, leading to code execution; users should upgrade the Smarty library.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-21408?

CVE-2021-21408 is a high-severity code injection vulnerability in Debian Debian Linux, published on 10 Jan 2022. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.43 and 4.0.3, template authors could run restricted static php methods. Users should upgrade to version 3.1.43 or 4.0.3 to receive a patch.

Weakness: CWE-20

Which versions are affected by CVE-2021-21408?

4 open source packages ship an affected version, including smarty/smarty. It affects 3 products.

PackageAffectedFixed in
smarty/smarty PackagistAll versions3.1.43
smarty/smarty PackagistAll versions3.1.43
smarty/smarty PackagistFrom 4.0.04.0.3
smarty/smarty PackagistFrom 4.0.04.0.3

Products include Debian Debian Linux, Fedoraproject Fedora, Smarty Smarty.

How do I fix CVE-2021-21408?

Upgrade smarty/smarty to a fixed version for your release line: 3.1.43 or 4.0.3.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2021-21408 being exploited?

There is no known exploitation of CVE-2021-21408 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-21408, GHSA-4h9c-v5vg-5m6m, UBUNTU-CVE-2021-21408.

Is CVE-2021-21408 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free