CVE-2022-29221: PHP Code Injection by malicious block or filename in Smarty

Published May 17, 2022
·
Updated

Last updated 24 July 2024

Other sources

PHP Code Injection by malicious block or filename

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.45 and 4.1.1, template authors could inject php code by choosing a malicious {block} name or {include} file name. Sites that cannot fully trust template authors should upgrade to versions 3.1.45 or 4.1.1 to receive a patch for this issue. There are currently no known workarounds.

Affected Software

10 affected componentsFixes available
composer/smarty/smarty<3.1.45, >=4.0.0, <4.1.1
Smarty smarty<3.1.45
Smarty smarty>=4.0.0<4.1.1
Debian Debian Linux=9.0
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Fedoraproject Fedora=36
Fedoraproject Fedora=37
debian/smarty3
3.1.39-2+deb11u13.1.39-2+deb11u23.1.47-2+deb12u13.1.48-2
debian/smarty4
4.3.0-1+deb12u24.5.5-1

Event History

May 17, 2022
Advisory Published
12:59 PM
May 24, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
May 26, 2022
Data Sourced
12:33 PM
SeverityAffected Software
Jan 12, 2024
Data Sourced
via Launchpad·12:08 AM
Description
Sep 16, 2024
Data Sourced
via Ubuntu·02:45 AM
RemedyDescriptionSeverityAffected Software
Mar 27, 2025
Data Sourced
via Debian·08:45 PM
DescriptionAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2022-29221?

CVE-2022-29221 is considered a high severity vulnerability due to its potential for PHP code injection which can lead to arbitrary code execution.

2

How do I fix CVE-2022-29221?

To fix CVE-2022-29221, update Smarty to version 3.1.45 or 4.1.1 or later.

3

Which versions of Smarty are affected by CVE-2022-29221?

CVE-2022-29221 affects Smarty versions prior to 3.1.45 and between 4.0.0 and 4.1.1.

4

What types of attacks can CVE-2022-29221 facilitate?

CVE-2022-29221 can facilitate PHP code injection attacks, allowing attackers to execute arbitrary PHP code on the server.

5

Is CVE-2022-29221 related to any specific software distributions?

Yes, CVE-2022-29221 impacts several distributions including Debian and Fedora, particularly certain versions of Smarty.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203