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
innerHTMLor 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.

