/

CVE-2026-32721

Severity:

HIGH RISK

(8.6)

XSS in LuCI Wireless Scan Modal on OpenWrt

CVE-2026-32721

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored XSS in administrative web interface, enabling JavaScript execution in the browser of authenticated OpenWrt administrators

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A stored cross-site scripting vulnerability in LuCI's wireless scan modal causes SSID values from Wi-Fi scan results to be rendered as raw HTML, without sanitization, in affected OpenWrt versions.

An attacker who controls or spoofs a Wi-Fi access point can inject malicious HTML/JavaScript into the LuCI interface, which executes in the administrator's browser when they open the wireless scan dialog.

Affected context

This vulnerability occurs in LuCI, the web-based configuration interface of OpenWrt, specifically in the wireless network scanning modal.

It affects OpenWrt systems using LuCI versions newer than 23.05/22.03 and before the patched builds, where:

  • The luci-mod-network package provides the wireless scan UI
  • The client-side wireless.js script renders SSIDs from scan results directly into the DOM via innerHTML
  • Administrators use the browser-based interface to scan for nearby Wi-Fi networks

The issue manifests only when a user opens the wireless scan modal to view nearby access points or channels, and at least one SSID in the scan results contains attacker-controlled content.

Exploit preconditions

  • Attack surface: Browser session of an authenticated LuCI user (usually an administrator) interacting with the wireless scan modal.
  • Required access: Ability to control or spoof an SSID visible to the OpenWrt device (e.g., running a nearby access point, rogue AP, or lab-controlled Wi-Fi network).
  • User interaction: The logged-in user must open the wireless scan modal (for example, to connect to a network or examine local Wi-Fi activity).
  • Trigger point: When the LuCI front-end processes scan results and calls dom.append() with an SSID in a template literal, which is rendered via innerHTML.
  • Why exploitation is possible: SSID strings from scan results are treated as trusted HTML and injected directly into the DOM without escaping or sanitization, allowing arbitrary script execution in the context of the LuCI origin.

Why this happens

The root cause is an insecure output handling pattern in the LuCI front-end code for the wireless scan feature.

In the luci-mod-network package, wireless.js constructs HTML using template literals that interpolate SSID values returned from wireless scan results and then passes the resulting string to dom.append(), which uses innerHTML under the hood.

Because SSIDs are not escaped, sanitized, or encoded before insertion, any HTML-like characters in the SSID are interpreted as markup or script by the browser.

This directly maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where untrusted input is embedded in an HTML context without appropriate output encoding.

Potential impact

  • An attacker-controlled SSID can cause execution of arbitrary JavaScript in the browser of an authenticated LuCI user.
  • Malicious script may access or modify LuCI session data and CSRF tokens visible to the page.
  • The attacker's script could issue administrative actions on the router's configuration with the victim's privileges (e.g., changing network settings, DNS, firewall rules).
  • Harvesting of sensitive information displayed in the LuCI interface or submission to an external endpoint.
  • Potential pivoting into the broader network environment through misconfiguration or deployment of malicious network policies initiated from the compromised admin session.

General mitigation guidance

Mitigation should focus on robust output encoding and secure UI rendering patterns for any untrusted data, including device-discovered values such as SSIDs:

  • Ensure all user-controlled or environment-controlled strings (like SSIDs) are HTML-escaped before insertion into the DOM, regardless of their origin.
  • Prefer safe DOM APIs that do not interpret strings as HTML, such as creating text nodes or using textContent/equivalents instead of innerHTML.
  • Centralize escaping routines for UI components so developers consistently apply proper encoding for HTML, attribute, and JavaScript contexts.
  • Treat data from local scans or system commands as untrusted, applying the same safety standards as for form input or external HTTP data.
  • Reduce the privileges associated with web administration accounts and sessions, and limit where possible which users can access the wireless configuration interfaces.

How teams detect issues like this

Detection efforts can combine code-level inspection with runtime analysis:

  • Static analysis: Configure linters or security-oriented static analyzers to flag uses of innerHTML, outerHTML, or similar sinks where data flows from unvalidated inputs (e.g., scan results, device discovery outputs).
  • Code review signals: Look for UI code that:
  • Embeds variables into HTML template literals
  • Uses DOM helpers that wrap innerHTML without enforcing escaping
  • Renders scan or discovery results without calling a common sanitization or encoding function
  • Automated review tools: Integrate SAST tools that understand source-to-sink data flows, highlighting cases where untrusted data (including environment- or network-derived values) reaches XSS-prone sinks.
  • Dynamic testing: Use browser automation or security testing tools to inject crafted SSIDs in a controlled environment and monitor for script execution in LuCI pages.

Sources

SourceLink
github.comgithub.com/openwrt/luci/commit/068150ba5f524ef6b03817b258d31ec310053fd6
github.comgithub.com/openwrt/luci/commit/cdce600aaec66f762f18d608c74cbf3abcafe1c7
github.comgithub.com/openwrt/luci/security/advisories/GHSA-vvj6-7362-pjrw

Frequently asked

questions

Not directly. Exploitation requires the attacker to control or spoof a Wi-Fi access point whose SSID is visible to the OpenWrt device and for an authenticated LuCI user to open the wireless scan modal in a browser.

No router login is required for the attacker; they only need to influence the SSID being broadcast. However, exploitation affects the browser of a user already authenticated to LuCI, and the impact is constrained by that user's privileges.

The most robust fix is to treat all external strings, including SSIDs, as untrusted and always perform context-appropriate output encoding before rendering them. Avoid passing unescaped data into innerHTML and instead use DOM APIs that handle text safely.

Adopt a secure-by-default rendering approach: standardize on safe templating mechanisms or frameworks that automatically escape values, add static checks for dangerous DOM APIs, and require security-focused code review for any UI component that displays environment- or user-derived data.

Find out what's already
exploitable in your codebase.