luci-mod-system: fix potential stored XSS
authorJo-Philipp Wich <jo@mein.io>
Fri, 13 Jan 2023 19:52:17 +0000 (20:52 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 13 Jan 2023 20:18:09 +0000 (21:18 +0100)
Make sure to escape the key contents in the delete confirmation dialog.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js

index df3e354e37fc669f728d96f362b31dbfd0b87147..a1748ad9907ea23c49e0cfbd231ca3f59be1fa83 100644 (file)
@@ -204,7 +204,7 @@ function removeKey(ev) {
 
        L.showModal(_('Delete key'), [
                E('div', _('Do you really want to delete the following SSH key?')),
-               E('pre', delkey),
+               E('pre', [ delkey ]),
                E('div', { class: 'right' }, [
                        E('div', { class: 'btn', click: L.hideModal }, _('Cancel')),
                        ' ',