From: Jo-Philipp Wich Date: Wed, 21 Sep 2022 12:47:41 +0000 (+0200) Subject: luci-mod-system: sshkeys.js: prevent XSS through pubkey comments X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=refs%2Fheads%2Fopenwrt-19.07;p=project%2Fluci.git luci-mod-system: sshkeys.js: prevent XSS through pubkey comments Ensure to not display public key comments verbatim in order to prevent injection of markup. Reported-by: Eric McDonald Signed-off-by: Jo-Philipp Wich (cherry picked from commit 944b55738e7f9685865d5298248b7fbd7380749e) --- diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js index 9269a69395..bbb6d050d2 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js @@ -109,7 +109,7 @@ function renderKeyItem(pubkey) { click: removeKey, 'data-key': pubkey.src }, [ - E('strong', pubkey.comment || _('Unnamed key')), E('br'), + E('strong', [ pubkey.comment || _('Unnamed key') ]), E('br'), E('small', [ '%s, %s'.format(pubkey.type, pubkey.curve || _('%d Bit').format(pubkey.bits)), pubkey.options ? E([], [