CVE-2026-32112: ha-mcp XSS Vulnerability in OAuth Consent Form
Summary
CVE-2026-32112: ha-mcp has XSS via Unescaped HTML in OAuth Consent Form. Affects ha-mcp versions < 7.0.0. Fixed in 7.0.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
ha-mcp is a Python package that facilitates OAuth authentication for various applications. It is designed to streamline the authorization process by allowing users to register and manage OAuth clients. The package includes a beta mode, 'ha-mcp-oauth', which is not part of the standard setup and requires explicit configuration. This mode is particularly vulnerable due to its handling of user-controlled parameters in the OAuth consent form.
Vulnerability Detail
The vulnerability arises from the use of unescaped HTML rendering in the OAuth consent form, specifically through Python f-strings in the 'consent_form.py' file. This allows an attacker to inject malicious JavaScript into the consent form by manipulating parameters such as 'client_name' and 'client_id'. If a server operator visits a crafted authorization URL, the injected script could execute in their browser, potentially exfiltrating sensitive information like the Home Assistant Long-Lived Access Token. The vulnerability is classified as a Cross-Site Scripting (XSS) issue (CWE-79) and primarily affects users running the beta OAuth mode.
How To Fix
Minimum fixed version
7.0.0
This is the first release that contains the fix.
pip install --upgrade "ha-mcp==7.0.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid using the beta OAuth mode ('ha-mcp-oauth') until the package is updated. Ensure that only trusted clients are registered and monitor access to the OAuth endpoint closely.
Conclusion
CVE-2026-32112 is a significant XSS vulnerability in the ha-mcp package's OAuth consent form, primarily affecting users of the beta OAuth mode. Immediate action is required to upgrade the package to mitigate potential risks associated with this vulnerability.
See every vulnerability recorded for ha-mcp →
FAQ
CVE-2026-32112 is a vulnerability in the ha-mcp package that allows for Cross-Site Scripting (XSS) attacks through unescaped HTML in the OAuth consent form.
Only users running the beta OAuth mode ('ha-mcp-oauth') are affected, as this mode requires explicit configuration and is not part of the standard setup.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If exploited, an attacker could execute JavaScript in the server operator's browser, potentially exfiltrating sensitive data such as access tokens.
Upgrade to version 7.0.0 or later of the ha-mcp package. Additionally, avoid using the beta OAuth mode until the update is applied.
References
Related vulnerabilities
Recent vulnerabilities recorded for ha-mcp.