CVE-2026-32112: Ha mcp Cross-Site Scripting Vulnerability
MODERATECVE-2026-32112 is a MODERATE (CVSS 6.8) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Ha mcp libraries in the PyPI ecosystem. The issue involves ha-mcp has xss via unescaped html in oauth consent form. Remediation is available by upgrading affected packages to version 7.0.0.
CVE-2026-32112 at a Glance
Security Impact
CVSS: 6.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2026-32112
To remediate this vulnerability, upgrade all affected Ha mcp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install ha-mcp>=7.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ha-mcp
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-32112, inspect your installed packages using pip:
pip show ha-mcp
Analyze the terminal output to locate any version of Ha mcp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.0), your application is affected.
Note: The pip show ha-mcp command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Ha mcp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-32112 Affected Ha mcp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ha-mcp
|
PyPI |
< 7.0.0
|
7.0.0
|
References
Frequently Asked Questions
What is CVE-2026-32112?
Which Ha mcp versions are affected?
What version fixes CVE-2026-32112?
Is ha-mcp affected?
What is the CVSS score of CVE-2026-32112?
What CWE is associated with CVE-2026-32112?
How can I check PyPI dependencies for CVE-2026-32112?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pf93-j98v-25pv",
"modified" : "2026-03-12T14:23:44Z",
"published" : "2026-03-12T14:23:44Z",
"aliases" : [ "CVE-2026-32112" ],
"summary" : "ha-mcp has XSS via Unescaped HTML in OAuth Consent Form",
"details" : "### Summary\n\nThe 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.\n\n### Details\n\n**Unescaped f-string rendering**\n\n`consent_form.py` builds HTML using Python f-strings. No call to `html.escape()` exists anywhere in the file. The following values are rendered unescaped:\n\n- `client_name` / `client_id` — in HTML element context (lines 299, 303)\n- `client_id`, `redirect_uri`, `state` — in HTML attribute context (lines 310–312), where a `\"` character breaks out of `value=\"\"`\n- `error_message`, `error`, `error_description` — in error display paths (lines 36–40, 496–497)\n\nAn attacker can register a client with a malicious `client_name` via the `/register` (DCR) endpoint, which accepts `client_name` without sanitization. If the server operator then visits a crafted authorization URL for that client, the payload executes in their browser.\n\n**Open Dynamic Client Registration**\n\nDCR is enabled by default with no initial access token required. This is intentional: Claude.ai and ChatGPT must self-register on first use, which is the standard MCP OAuth flow (RFC 7591). Requiring a pre-shared token would break those integrations. Registration alone grants no access — authorization requires an explicit action by the server operator.\n\n### Impact\n\n**Affected configuration:** OAuth mode only (`ha-mcp-oauth`, requires `MCP_BASE_URL`). This mode is in beta and is not included in the main setup documentation. The vast majority of ha-mcp users run stdio mode, which is not affected.\n\n**Attack requirements:**\n1. The attacker can reach the ha-mcp OAuth endpoint (it binds to `0.0.0.0` in HTTP mode)\n2. The attacker registers a malicious client via `/register`\n3. The attacker convinces the **server operator** — the person who set up ha-mcp — to follow a crafted authorization URL for an unrecognized application\n\nStep 3 is a meaningful social engineering bar: the consent form displays the (unfamiliar) application name, and the operator has no legitimate reason to authorize an OAuth client they didn't initiate through Claude.ai or ChatGPT. Normal usage involves being redirected to the consent form from one of those platforms, not from an external link.\n\nIf exploited, a JavaScript payload could exfiltrate data entered into the consent form, including the Home Assistant Long-Lived Access Token.\n\n### Fix\n\nUpgrade to 7.0.0",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ha-mcp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-pf93-j98v-25pv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32112"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/homeassistant-ai/ha-mcp"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-12T14:23:44Z",
"nvd_published_at" : "2026-03-11T21:16:17Z"
}
}