VYPR
Moderate severityNVD Advisory· Published Mar 11, 2026· Updated Mar 12, 2026

ha-mcp has XSS via Unescaped HTML in OAuth Consent Form

CVE-2026-32112

Description

ha-mcp is a Home Assistant MCP Server. Prior to 7.0.0, the ha-mcp OAuth consent form renders user-controlled parameters via Python f-strings with no HTML escaping. An attacker who can reach the OAuth endpoint and convince the server operator to follow a crafted authorization URL could execute JavaScript in the operator's browser. This affects only users running the beta OAuth mode (ha-mcp-oauth), which is not part of the standard setup and requires explicit configuration. This vulnerability is fixed in 7.0.0.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

ha-mcp OAuth consent form has XSS via unescaped f-string rendering; fixed in 7.0.0.

Vulnerability

Description

The ha-mcp OAuth consent form prior to version 7.0.0 uses Python f-strings to render user-controlled parameters without HTML escaping, leading to a cross-site scripting (XSS) vulnerability [1][3]. Specifically, the consent_form.py file builds HTML via f-strings but never calls html.escape() [3]. Parameters such as client_name, client_id, redirect_uri, and state are rendered unescaped in HTML element or attribute contexts, allowing injection of arbitrary HTML and JavaScript [3].

Exploitation

An attacker who can reach the ha-mcp OAuth endpoint can register a malicious client via the Dynamic Client Registration (DCR) endpoint (/register), which accepts client_name without sanitization [3]. The attacker then convinces the server operator to follow a crafted authorization URL for that client. If the operator visits the URL, the malicious JavaScript executes in their browser [2][3]. The attack affects only users running the beta OAuth mode (ha-mcp-oauth), which requires explicit configuration and is not part of the standard setup [2][3].

Impact

Successful exploitation allows the attacker to execute arbitrary JavaScript in the context of the server operator's browser session, potentially leading to session hijacking, data theft, or further actions within the Home Assistant environment [3]. The vulnerability does not affect the default stdio mode [3].

Mitigation

The vulnerability is fixed in ha-mcp version 7.0.0 [1][2][3]. Users running the beta OAuth mode should upgrade immediately. No workarounds are available for affected versions [3].

AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
ha-mcpPyPI
< 7.0.07.0.0

Affected products

1
  • homeassistant-ai/ha-mcpv5
    Range: < 7.0.0

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

3

News mentions

0

No linked articles in our index yet.