All vulnerabilities

Servers and applications

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 them

Severity
Medium 6.1
Published
27 Nov 2026
Last changed
27 Nov 2026
Added to UpHeron
27 Nov 2026
Fixed in
4.6.1, 5.9.1
Weakness
Cross-site scripting (CWE-79)
Attack
Over the network · No login needed · Needs someone to click or open something
Attacker can
Read some data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Sources
Project advisories (GitHub)

Description

{html_options} recognises name, class and id in its own switch, and {html_select_date} / {html_select_time} recognise field_array, prefix and the *_empty family. None of these six are passed through smarty_function_escape_special_chars(). Every other parameter in the same handlers is: option values and labels, , selected, the id attribute built from the very same $_name string, and every unrecognised attribute on the $extra path. The six are concatenated straight into , , and content, so a value containing a double quote closes the attribute and everything after it becomes new attributes on the tag; a *_empty` value does not even need a quote, because it lands in element content.

Function handlers are compiled with nofilter (src/Compiler/Template.php:1152, commented "functions are never auto-escaped"), so $escape_html does not cover them either, and I took every measurement below with it turned on rather than off.

From smarty-php/smarty's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
SmartyServers and applications · github:smarty-php/smarty
  • Every version before 4.6.1
  • From 5.0.0 before 5.9.1

About Smarty

Web template system in PHP

From Wikidata, CC0 1.0.
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

References