Remote Code Execution Vulnerability in Smarty Package (CVE-2014-8350)

smarty3 Updated 02 Oct 2025

Summary

03/11/2014
N/A
Yes i
Unrated
Not published

CVE-2014-8350: Smarty before 3.1.21 allows remote attackers to bypass the secure mode restrictions and execute arbitrary PHP code as demonstrated by "{literal}" in a template. Affects smarty3 versions < 3.1.21-1. Fixed in 3.1.21-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Smarty is a popular template engine for PHP, designed to facilitate the separation of presentation and logic in web applications. It allows developers to create dynamic web pages with ease, providing features such as caching, template inheritance, and a robust syntax for variable manipulation. However, prior to version 3.1.21, Smarty had a critical vulnerability that allowed attackers to bypass secure mode restrictions, potentially leading to remote code execution.

Vulnerability Detail

The vulnerability, identified as CVE-2014-8350, arises from improper handling of the secure mode in Smarty versions prior to 3.1.21. This flaw permits remote attackers to inject arbitrary PHP code into templates by exploiting the literal tag. For example, an attacker could use the code snippet '{literal}<{/literal}script language=php>' to execute malicious PHP code on the server. The implications of this vulnerability are severe, as it could lead to unauthorized access, data breaches, or complete server compromise.

How To Fix

Minimum fixed version

3.1.21-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade smarty3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If an immediate upgrade is not feasible, consider disabling the use of the literal tag in templates until the upgrade can be performed. This can help mitigate the risk of code injection. However, this is not a permanent solution and should only be a temporary measure.

Conclusion

CVE-2014-8350 represents a significant security risk for applications using vulnerable versions of the Smarty template engine. Upgrading to version 3.1.21 or later is essential to safeguard against potential remote code execution attacks. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert, which can provide real-time alerts without requiring code access.

See every vulnerability recorded for smarty3 →

Share this vulnerability

FAQ

CVE-2014-8350 is a vulnerability in the Smarty template engine that allows remote code execution due to improper handling of secure mode.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your manifest file for vulnerabilities.

The risks include unauthorized access to the server, potential data breaches, and the ability for attackers to execute arbitrary code.

Yes, temporarily disabling the use of the literal tag in templates can help mitigate the risk until an upgrade can be performed.

After upgrading, thoroughly test your application to ensure that all functionalities work as expected and that no new issues have been introduced.

Related vulnerabilities

Recent vulnerabilities recorded for smarty3.

How To Fix

Minimum fixed version

3.1.21-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade smarty3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback