luci-mod-network: escape WiFi SSID on Scanning AP modal
authorChristian Marangi <redacted>
Thu, 12 Mar 2026 15:07:49 +0000 (16:07 +0100)
committerChristian Marangi <redacted>
Fri, 13 Mar 2026 18:15:53 +0000 (19:15 +0100)
commit068150ba5f524ef6b03817b258d31ec310053fd6
treee5036ff268bcfa9aa96e551bf7dcdcdc50266b9d
parent5e9c736a9c661b6d2aec11022cecc59f40f6b628
luci-mod-network: escape WiFi SSID on Scanning AP modal

After the ES2016 rework, a very old bug was reverted where the WiFi SSID was
treated as raw HTML and directly appended to DOM.

This might result in XSS vulnerability with specially crafted SSID from the
Access Point around.

This is only triggered on opening the modal as the normal wireless.js view
doesn't scan the Access Point.

To fix this and make it more clear that SSID must be always escaped, move the
SSID handling to a dedicated variable and use the document.createTextNode()
to escape it similar to how it's done in similar place like the
channel_analysis.js

Fixes: cdce600aaec6 ("luci-mod-network: give wireless.js ES2016 treatment and refactor")
Reported-by: Sasha Romijn <redacted>
Signed-off-by: Christian Marangi <redacted>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
git clone https://git.99rst.org/PROJECT