Gentoo Logo

Smarty: Template vulnerability


1.  Gentoo Linux Security Advisory

Version Information

Advisory Reference GLSA 200503-35 / smarty
Release Date March 30, 2005
Latest Revision May 22, 2006: 03
Impact high
Exploitable remote
Package Vulnerable versions Unaffected versions Architecture(s)
dev-php/smarty < 2.6.9 >= 2.6.9 All supported architectures

Related bugreports: #86488


Smarty's "Template security" feature can be bypassed, potentially allowing a remote attacker to execute arbitrary PHP code.

2.  Impact Information


Smarty is a template engine for PHP. The "template security" feature of Smarty is designed to help reduce the risk of a system compromise when you have untrusted parties editing templates.


A vulnerability has been discovered within the regex_replace modifier of the Smarty templates when allowing access to untrusted users. Furthermore, it was possible to call functions from {if} statements and {math} functions.


These issues may allow a remote attacker to bypass the "template security" feature of Smarty, and execute arbitrary PHP code.

3.  Resolution Information


Do not grant template access to untrusted users.


All Smarty users should upgrade to the latest version:

Code Listing 3.1: Resolution

# emerge --sync
# emerge --ask --oneshot --verbose ">=dev-php/smarty-2.6.9"

4.  References


Page updated March 30, 2005

Summary: This is a Gentoo Linux Security Advisory

Security Team
Contact Address

Donate to support our development efforts.

Copyright 2001-2015 Gentoo Foundation, Inc. Questions, Comments? Contact us.