Servers and applications
GHSA-p927-2m49-9p39
Cached page output can become PHP code in the cache file: unescaped quote in the PHP-tag wrapper, and an unchecked pattern failure
- Severity
- High 8.1
- Published
- 27 Nov 2026
- Last changed
- 27 Nov 2026
- Added to UpHeron
- 27 Nov 2026
- Fixed in
- 4.6.1, 5.9.1
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Read data · Change data · Take it down
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H- Sources
- Project advisories (GitHub)
Description
With caching on, Smarty writes the rendered output of a page into a cache file and runs that file with include. To keep PHP-looking tags in the output from running, removeNoCacheHash() wraps every match of a tag pattern in a small PHP statement that echoes the tag from a single-quoted string. Two defects in those lines let text printed on the page end up as PHP code in the cache file:
- Unescaped quote. The matched tag is put into the single-quoted string as it is. One alternative of the pattern, the legacy script tag with a language attribute naming php, may contain a single quote. A match with a single quote after the word php ends the string early, and what follows the tag in the output is compiled as PHP.
- Unchecked failure. When the pattern match itself fails (preg_match() returns false at pcre.backtrack_limit), the code reads that as "no tag found" and copies the whole text into the cache file with no wrapping at all.
Affected software
| Software | Affected versions |
|---|---|
SmartyServers and applications · github:smarty-php/smarty |
|
About Smarty
Web template system in PHP
- Monthly downloads (Packagist)
- 1,214,404Packagist, 29 Nov 2026
- Total downloads (Packagist)
- 47,010,492Packagist, 29 Nov 2026
- GitHub stars
- 2,352GitHub, 29 Nov 2026
- Forks
- 704GitHub, 29 Nov 2026
- Latest release
- v5.9.1GitHub, 29 Nov 2026
- Released
- 27 Nov 2026GitHub
- License
- GNU Lesser General Public LicenseWikidata
- Written in
- PHPWikidata
- First released
- 2001Wikidata
- First published on GitHub
- 30 Oct 2014GitHub
Vulnerabilities in Smarty
- In our list
- 39
- Published in the last 12 months
- 7
- Critical, last 12 months
- 1
- High, last 12 months
- 1
- Known exploited
- 0
- GHSA-966m-5mq6-5q48{html_options}, {html_select_date} and {html_select_time} emit six named parameters into attribute values and <option> content unescaped, allowing XSS in applications that pass untrusted values to themMedium 6.1 27 Nov 2026
- GHSA-x8f6-7h7x-vqq8SSRF vulnerability in Smarty {html_image} redirectsLow 27 Nov 2026
- CVE-2026-82531Missing nocache-hash restoration lets assigned data inject executable PHP into regenerated cache filesCritical 9.2 4 Oct 2026
- CVE-2026-62996Smarty Security stream restriction bypass through stream: resourceMedium 20 Jul 2026
- CVE-2026-62993SSRF via redirect bypass of trusted_uri using {fetch}Medium 20 Jul 2026
- CVE-2026-62992Symlink path traversal out of trusted directoriesMedium 20 Jul 2026
References
- GitHub Advisory Database https://github.com/advisories/GHSA-p927-2m49-9p39
- github.com https://github.com/smarty-php/smarty/security/advisories/GHSA-p927-2m49-9p39