themes: Call striptags() on hostname to prevent XSS
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 8 Jun 2021 23:28:44 +0000 (01:28 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 9 Jun 2021 18:53:15 +0000 (20:53 +0200)
commit139edfce8b2e9092255be78700eb3d57a564e54e
tree24c89b4627cea6dc606e7081baa193476815bd26
parentaaac84602ddca17699352db90e050a15be46ef91
themes: Call striptags() on hostname to prevent XSS

This calls striptags() on the hostname to prevent any XSS over the
hostname. This should fix CVE-2021-33425 as far as I understood it.

If someone adds some Javascript into system.@system[0].hostname it would
have been directly added to the page, this prevents the problem.

This can only be exploited by someone being able to modify the uci
configuration, normally a user with such privileges could also just
modify the webpage.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 5cbd79d7e31c0f0feaea2770bf102bbae7831e3c)
themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm
themes/luci-theme-material/luasrc/view/themes/material/header.htm
themes/luci-theme-openwrt-2020/luasrc/view/themes/openwrt2020/header.htm
themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm