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 5cbd79d7e3
)
This commit is contained in:
parent
91f3929500
commit
15ca915da9
3 changed files with 3 additions and 3 deletions
|
@ -41,7 +41,7 @@
|
|||
<header>
|
||||
<div class="fill">
|
||||
<div class="container">
|
||||
<a class="brand" href="#"><%=boardinfo.hostname or "?"%></a>
|
||||
<a class="brand" href="#"><%=striptags(boardinfo.hostname or "?")%></a>
|
||||
<ul class="nav" id="topmenu" style="display:none"></ul>
|
||||
<div id="indicators" class="pull-right"></div>
|
||||
</div>
|
||||
|
|
|
@ -190,7 +190,7 @@
|
|||
<div class="container">
|
||||
<span class="showSide"></span>
|
||||
<a id="logo" href="<% if luci.dispatcher.context.authsession then %><%=url('admin/status/overview')%><% else %>#<% end %>"><img src="<%=media%>/brand.png" alt="OpenWrt"></a>
|
||||
<a class="brand" href="#"><%=boardinfo.hostname or "?"%></a>
|
||||
<a class="brand" href="#"><%=striptags(boardinfo.hostname or "?")%></a>
|
||||
<div class="status" id="indicators">
|
||||
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
|
||||
<span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%></span> <%:on%></span>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<h2 class="navigation"><a id="navigation" name="navigation"><%:Navigation%></a></h2>
|
||||
|
||||
<div class="hostinfo">
|
||||
<%=(boardinfo.hostname or "?")%> | <%=ver.distversion%> |
|
||||
<%=striptags(boardinfo.hostname or "?")%> | <%=ver.distversion%> |
|
||||
<%:Load%>: <%="%.2f" % (loadinfo[1] / 65535.0)%> <%="%.2f" % (loadinfo[2] / 65535.0)%> <%="%.2f" % (loadinfo[3] / 65535.0)%>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue