mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 19:14:34 +04:00
luci-base: dispatcher.uc: prevent XSS through 404 error template
Make sure to escape the user controlled URL passed as part of the error message into the error404 template in order to avoid XSS. Reported-by: 40826d <40826d@posteo.de> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<script type="text/javascript" src="{{ resource }}/promis.min.js"></script>
|
||||
<script type="text/javascript" src="{{ resource }}/luci.js"></script>
|
||||
<script type="text/javascript">
|
||||
L = new LuCI({{ {
|
||||
L = new LuCI({{ replace(`${ {
|
||||
media : media,
|
||||
resource : resource,
|
||||
scriptname : http.getenv("SCRIPT_NAME"),
|
||||
@@ -28,5 +28,5 @@
|
||||
apply_timeout : max(+config.apply.timeout || 5, 1),
|
||||
apply_display : max(+config.apply.display || 1.5, 1),
|
||||
rollback_token : rollback_token
|
||||
} }});
|
||||
} }`, '/', '\\/') }});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user