/

CVE-2026-45323

Severity:

CRITICAL RISK

(9.6)

XSS in MeshCore Lovelace Card for Home Assistant

CVE-2026-45323

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Arbitrary JavaScript Execution in User Browsers

Severity:

CRITICAL RISK

(9.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

MeshCore Lovelace card for Home Assistant renders Meshcore node names in the frontend without proper HTML escaping, leading to a stored cross-site scripting (XSS) vulnerability.

Any node within direct or indirect radio range that can influence node names may inject malicious JavaScript, which executes in the browser of any user viewing the vulnerable card.

Affected context

The vulnerability affects Home Assistant setups that use the MeshCore Lovelace card to display Meshcore node information.

It becomes relevant when node names originate from the mesh network and are displayed directly in the Home Assistant frontend without server-side or client-side sanitization.

Environments where mesh nodes can be added or influenced by untrusted parties, including via repeated or indirect radio hops, are particularly exposed.

Exploit preconditions

  • Attack surface: Home Assistant frontend rendered in users' web browsers via the MeshCore Lovelace card.
  • Required access: Ability to control or influence the name of at least one Meshcore node within direct or indirect (repeated) radio range of the mesh network.
  • Trigger point: A user with access to the Home Assistant UI views a page containing the vulnerable MeshCore card that displays the malicious node name.
  • Why exploitation is possible: Node names are inserted into the DOM without proper HTML escaping or output encoding, allowing attacker-supplied markup and script to be interpreted by the browser as active content.

Why this happens

The underlying issue is improper neutralization of untrusted input before it is included in a web page, mapping directly to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

Meshcore node names, which may be influenced by external devices over radio, are treated as trusted display strings and are rendered in the Lovelace card without HTML escaping or context-appropriate output encoding.

Because the application does not enforce a clear trust boundary between mesh-originated data and the frontend, attacker-controlled node names can inject script tags or event handlers that the browser executes with the privileges of the Home Assistant web session.

Potential impact

  • Execution of arbitrary JavaScript in the context of the Home Assistant frontend session.
  • Theft of session information or sensitive data accessible via the web UI.
  • Unauthorized actions performed on behalf of the victim user through the Home Assistant APIs exposed in the browser.
  • Manipulation of the Home Assistant interface to mislead users or hide malicious activity.
  • Pivoting into additional attacks if the injected script interacts with other local services exposed to the browser.

General mitigation guidance

At a design level, mitigation focuses on treating all node-originated data as untrusted and enforcing strict output encoding.

Recommended patterns include:

  • Applying context-appropriate HTML escaping or templating mechanisms for all user- or device-supplied fields before inserting them into the DOM.
  • Using framework features that automatically escape variables in UI templates instead of building HTML strings manually.
  • Applying a clear separation between data and markup, for example by binding text content via safe APIs rather than innerHTML-style operations.
  • Limiting the expressiveness of remote node metadata (e.g., allowing only constrained character sets for node names) to reduce the risk surface.
  • Operating the Home Assistant environment and add-ons with least-privilege permissions, so that a compromised frontend has reduced ability to cause harm.

How teams detect issues like this

Detection generally relies on identifying unsafe rendering patterns and validating the behavior of the UI under adversarial input.

Useful approaches include:

  • Static analysis rules or linters that flag direct insertion of untrusted data into HTML contexts without encoding, especially when using innerHTML or similar APIs.
  • Code review checklists that require verification of output encoding for all external or device-originated fields rendered in the UI.
  • Automated tests that feed representative malicious payloads into node names and assert they are rendered as inert text rather than executable code.
  • Runtime security testing or browser-based scanning tools that crawl the UI and check for reflections or storage of script-like content originating from external data sources.

Sources

SourceLink
github.comgithub.com/jpettitt/meshcore-card/security/advisories/GHSA-5vrg-xpcj-xppc

Frequently asked

questions

It can be exploitable over the mesh network rather than traditional TCP/IP, provided an attacker can introduce or control a node that influences node names within radio range of the mesh. Once malicious data is present, any user who loads the affected Lovelace card in a browser can be impacted.

The attacker needs the ability to control or modify a Meshcore node's name within the mesh network (directly or through repeated radio hops). They do not need direct access to the Home Assistant UI or server; exploitation occurs when a legitimate user views the card that displays the crafted node name.

The most robust fix pattern is to enforce strict, context-aware output encoding (HTML escaping for HTML context, attribute encoding for attributes, etc.) for all untrusted data, and to rely on templating or UI frameworks that escape data by default instead of manually constructing HTML.

Establish a secure frontend development standard that treats all external, device, or user-supplied data as untrusted; require automatic escaping in UI layers; avoid direct innerHTML-style APIs; and integrate security-focused code review and automated scanning to catch new instances of unencoded output early in the development lifecycle.

Find out what's already
exploitable in your codebase.