CVE-2026-32112: ha-mcp has XSS via Unescaped HTML in OAuth Consent Form

Published Mar 11, 2026
·
Updated

Summary

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.

Details

Unescaped f-string rendering

consentform.py builds HTML using Python f-strings. No call to html.escape() exists anywhere in the file. The following values are rendered unescaped:

- clientname / clientid — in HTML element context (lines 299, 303) - clientid, redirecturi, state — in HTML attribute context (lines 310–312), where a " character breaks out of value="" - errormessage, error, errordescription — in error display paths (lines 36–40, 496–497)

An attacker can register a client with a malicious clientname via the /register (DCR) endpoint, which accepts clientname without sanitization. If the server operator then visits a crafted authorization URL for that client, the payload executes in their browser.

Open Dynamic Client Registration

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

Impact

Affected configuration: OAuth mode only (ha-mcp-oauth, requires MCPBASEURL). 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.

Attack requirements: 1. The attacker can reach the ha-mcp OAuth endpoint (it binds to 0.0.0.0 in HTTP mode) 2. The attacker registers a malicious client via /register 3. The attacker convinces the server operator — the person who set up ha-mcp — to follow a crafted authorization URL for an unrecognized application

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

If exploited, a JavaScript payload could exfiltrate data entered into the consent form, including the Home Assistant Long-Lived Access Token.

Fix

Upgrade to 7.0.0

Other sources

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.

MITRE

Affected Software

3 affected componentsFixes available
Home Assistant ha-mcp<7.0.0
pip/ha-mcp<7.0.0
7.0.0
Homeassistant-ai Home Assistant Mcp Server<7.0.0

Event History

Mar 11, 2026
CVE Published
via MITRE·08:42 PM
Data Sourced
via MITRE·08:42 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
Affected Software
Mar 12, 2026
Advisory Published
via GitHub·02:23 PM
Data Sourced
via GitHub·02:23 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-32112?

CVE-2026-32112 has a high severity rating due to the risk of Cross-Site Scripting (XSS) attacks.

2

How do I fix CVE-2026-32112?

To remediate CVE-2026-32112, upgrade to version 7.0.0 or higher of ha-mcp.

3

What impact does CVE-2026-32112 have on my application?

CVE-2026-32112 allows for the possibility of XSS attacks that could lead to data theft or hijacking sessions.

4

Who is affected by CVE-2026-32112?

Users of Home Assistant ha-mcp versions prior to 7.0.0 are affected by CVE-2026-32112.

5

Is there a workaround for CVE-2026-32112?

There are no official workarounds for CVE-2026-32112; the recommended action is to upgrade to the fixed version.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203