luci-base: form.js: do not execute embedded script code in stripTags()
authorJo-Philipp Wich <jo@mein.io>
Thu, 23 Dec 2021 16:06:09 +0000 (17:06 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 23 Dec 2021 16:08:21 +0000 (17:08 +0100)
commit993151504e8e810c083d3257555bdcdc2f00673a
tree011ed8da414f36857a689cc8d95b479d24b6864c
parentcac0349d26445dc023af69fa8788ca1d2d8f70d4
luci-base: form.js: do not execute embedded script code in stripTags()

Instead of relying on .innerHTML which executes embedded script code to
parse a given HTML fragment, use dom.parse() which utilizies DOMParser()
internally in order to extract textContent in a safe manner.

Fixes: FS#4199
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=4199
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/form.js