Smarty: Template vulnerability — GLSA 200503-35

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

Affected Packages

dev-php/smarty on all architectures
Affected versions < 2.6.9
Unaffected versions >= 2.6.9

Background

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.

Description

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.

Impact

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

Workaround

Do not grant template access to untrusted users.

Resolution

All Smarty users should upgrade to the latest version:

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

References

Release Date
March 30, 2005

Latest Revision
May 22, 2006: 03

Severity
high

Exploitable
remote

Bugzilla entries