Description
The _expand_quoted_text function in libs/Smarty_Compiler.class.php in Smarty 2.6.20 before r2797 allows remote attackers to execute arbitrary PHP code via vectors related to templates and (1) a dollar-sign character, aka "php executed in templates;" and (2) a double quoted literal string, aka a "function injection security hole." NOTE: each vector affects slightly different SVN revisions.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 5.0 | smarty | 2.6.20-1.2 | DSA-1919-1 |
| Debian 4.0 | moodle | 1.6.3-2+etch1 | DSA-1691-1 |
| Debian 4.0 | smarty | 2.6.14-1etch2 | DSA-1919-1 |
Advisories 2
- DSA-1919-1 smarty - several vulnerabilities Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-1691-1 moodle - several vulnerabilities Debian Security (DSA / DLA) · Mar 9, 2026
References
- 32329 third-party-advisory
- 31862 vdb-entry
- smarty-expandquotedtext-code-execution(46031) vdb-entry
- DSA-1691 vendor-advisory
- http://code.google.com/p/smarty-php/source/detail?r=2784&path=/trunk/libs/Smarty_Compiler.class.php
- http://securityvulns.ru/Udocument746.html
- https://bugs.gentoo.org/attachment.cgi?id=169804&action=view
- http://smarty-php.googlecode.com/svn/trunk/NEWS
- http://code.google.com/p/smarty-php/source/detail?r=2797&path=/trunk/libs/Smarty_Compiler.class.php
- [oss-security] 20081025 Regarding SA32329 (Smarty "_expand_quoted_text()" Security Bypass) mailing-list