Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 86488

Summary: dev-php/smarty Release 2.6.8 contains security fixes
Product: Gentoo Security Reporter: Andreas Korthaus <akorthaus>
Component: GLSA ErrorsAssignee: Gentoo Security <security>
Status: RESOLVED FIXED    
Severity: major CC: php-bugs, tomk
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://news.php.net/php.smarty.dev/2673
Whiteboard: C1 [glsa]
Package list:
Runtime testing required: ---

Description Andreas Korthaus 2005-03-24 01:42:55 UTC
Smarty 2.6.8 Released

[21-March-2005] For those using template security: A vulnerability in the regex_replace modifier has been fixed that allowed PHP code to be executed from a template, even with template security enabled. If you are using template security features, it is highly recommended to upgrade, or at least replace the modifier plugin. A problem with the {strip}{/strip} tags (that was introduced in 2.6.7) has been fixed. Casting objects to arrays in the {foreach} "item" attribute has been addressed.

ChangeLog: http://smarty.php.net/misc/NEWS
download: http://smarty.php.net/download.php

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Thierry Carrez (RETIRED) gentoo-dev 2005-03-24 02:16:28 UTC
PHP team, please bump
Comment 2 Sebastian Bergmann (RETIRED) gentoo-dev 2005-03-24 08:32:23 UTC
dev-php/smarty-2.6.8 is in portage now.
Comment 3 Thierry Carrez (RETIRED) gentoo-dev 2005-03-24 09:18:03 UTC
Arches: please test and mark stable
Comment 4 Jason Wever (RETIRED) gentoo-dev 2005-03-24 19:46:47 UTC
Stable on SPARC.
Comment 5 Sebastian Bergmann (RETIRED) gentoo-dev 2005-03-24 21:17:45 UTC
Stable on x86 and amd64.
Comment 6 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-03-25 01:36:08 UTC
Stable on ppc.
Comment 7 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-03-25 13:07:22 UTC
Stable on hppa, thanks to KillerFox for testing.
Comment 8 Bryan Østergaard (RETIRED) gentoo-dev 2005-03-26 10:19:52 UTC
Stable on alpha.
Comment 9 Thierry Carrez (RETIRED) gentoo-dev 2005-03-30 06:53:36 UTC
GLSA 200503-35
Comment 10 Tom Knight (RETIRED) gentoo-dev 2005-04-08 06:48:51 UTC
Smarty 2.6.9 has been released with some more security fixes, I'll add the ebuild soon.
Comment 11 Thierry Carrez (RETIRED) gentoo-dev 2005-04-08 06:53:49 UTC
will be released as an update to GLSA 200503-35
Comment 12 Tom Knight (RETIRED) gentoo-dev 2005-04-08 08:07:00 UTC
smarty{,-docs}-2.6.9 in cvs, stable on x86 and amd64. Arches please mark stable.
Comment 13 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-04-08 10:24:15 UTC
Stable on ppc.
Comment 14 Bryan Østergaard (RETIRED) gentoo-dev 2005-04-08 12:20:25 UTC
Alpha stable.
Comment 15 Gustavo Zacarias (RETIRED) gentoo-dev 2005-04-08 18:02:19 UTC
sparc done.
Comment 16 Thierry Carrez (RETIRED) gentoo-dev 2005-04-09 09:20:01 UTC
security: UPDATE draft sent, please approve
Comment 17 Thierry Carrez (RETIRED) gentoo-dev 2005-04-10 09:43:09 UTC
UPDATE sent
Comment 18 Monte Ohrt 2006-04-06 06:43:11 UTC
Just a note, this is a misleading bullitin (and showing up high in google results):

http://www.gentoo.org/security/en/glsa/glsa-200503-35.xml

The vulnerability does not open attacks from remote users, it only allows someone with direct access to template files to execute PHP commands from within the template. It would be good for someone to change that wording, thanks.
Comment 19 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-04-06 10:55:49 UTC
tomk/php-bugs/auditors please advise wether this is remotely exploitable.
Comment 20 Tom Knight (RETIRED) gentoo-dev 2006-04-06 11:20:25 UTC
(In reply to comment #19)
> tomk/php-bugs/auditors please advise wether this is remotely exploitable.
> 

According to the first entry in: http://smarty.php.net/index_archive.php it's not remotely exploitable. You need local access to the smarty template files to be able bypass certain checks when template security is enabled. That being said, when such a template has been created by a local user then the vulnerable code would be run when accessed remotely via the webserver. I'm unsure as to the criteria used to determine whether that is defined as being locally or remotely exploitable.
Comment 21 Thierry Carrez (RETIRED) gentoo-dev 2006-04-07 13:40:17 UTC
I defined it as remotely exploitable because smarty's "template security" feature is typically used to allow untrusted users to plug their own template in a PHP application (for example, a bulletin board that allows users to customize templates). The hole is that the "template security" feature can be bypassed to allow to execute arbitrary code while theorically this should not be possible for those users. In which case the hole is remote, because the attacker doesn't need to be a local user.

I agree it's a little misleading to use the term "Remote attacker" everywhere, since the attack can only be remote if the application allows users to upload their own templates...
Comment 22 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-10 15:28:47 UTC
> I defined it as remotely exploitable because smarty's "template security"
> feature is typically used to allow untrusted users to plug their own template
> in a PHP application (for example, a bulletin board that allows users to
> customize templates).

yes, but generally, such PHP interfaces are reserved with an authentication device (at least, i hope so). Consequently, the potential attackers are not totally "unknown". This is remote but reserved for known members of a group.

Well i think this doens't worth any update and we could close it.
Comment 23 Tavis Ormandy (RETIRED) gentoo-dev 2006-04-22 06:53:35 UTC
I think we can close this bug now, please REOPEN if anyone disagrees.