Headline
CVE-2023-24181: Reflected Cross Site Scripting in OpenWRT LuCI Web Interface.
LuCI openwrt-22.03 branch git-22.361.69894-438c598 was discovered to contain a reflected cross-site scripting (XSS) vulnerability via the component /openvpn/pageswitch.htm.
Impact
An attacker can send this URL with a malicious payload to genuine Luci user which can lead to execution of payload on Luci console. It can lead to session hijacking attacks. The vulnerability can further help attackers to bypass protection mechanism like same origin policy (CSP) and Anti-CSRF tokens.
Proof of Concept
- Login to Luci Console using valid credentials.
- Paste below payload in Browser window.
Payload: <img src=a onerror=alert(‘xss’)>
https://{your-luci-ip}/cgi-bin/luci/root/vpn/openvpn/basic/sample_serverjyo69%3Cimg%20src%3da%20onerror%3dalert(‘xss’)%3Ezja1d
You will see JavaScript being executed and XSS pop-up will appear. Please find attached Proof of concept video for more details.
Patches
openwrt/luci@25983b9
openwrt/luci@749268a
Workarounds
It is recommended to pull the patch from the OpenWRT LuCi Repository to mitigate this vulnerability.