GHSA-FMFG-9G7C-3VQ7
Vulnerability from github – Published: 2026-03-12 14:23 – Updated: 2026-03-12 14:23Summary
The ha-mcp OAuth consent form (beta feature) accepts a user-supplied ha_url and makes a server-side HTTP request to {ha_url}/api/config with no URL validation. An unauthenticated attacker can submit arbitrary URLs to perform internal network reconnaissance via an error oracle. Two additional code paths in OAuth tool calls (REST and WebSocket) are affected by the same primitive.
The primary deployment method (private URL with pre-configured HOMEASSISTANT_TOKEN) is not affected.
Details
Code path 1 — Consent form validation (reported)
When a user submits the OAuth consent form, _validate_ha_credentials() (provider.py) makes a server-side GET request to {ha_url}/api/config with no scheme, IP, or domain validation. Different exception types produce distinct error messages, creating an error oracle:
| Outcome | Message returned | Information leaked |
|---|---|---|
ConnectError |
"Could not connect..." | Host down or port closed |
TimeoutException |
"Connection timed out..." | Host up, port filtered |
| HTTP 401 | "Invalid access token..." | Service alive, requires auth |
| HTTP 403 | "Access forbidden..." | Service alive, forbidden |
| HTTP ≥ 400 | "Failed to connect: HTTP {N}" | Service alive, exact status |
An attacker can drive the flow programmatically: register a client via open DCR (POST /register), initiate authorization, extract a txn_id, and submit arbitrary ha_url values. No user interaction required.
Code path 2 — REST tool calls with forged token
OAuth access tokens are stateless base64-encoded JSON payloads ({"ha_url": "...", "ha_token": "..."}). Since tokens are not signed, an attacker can forge a token with an arbitrary ha_url. REST tool calls then make HTTP requests to hardcoded HA API paths on that host (/config, /states, /services, etc.). JSON responses are returned to the caller.
In practice, path control is limited — most endpoints use absolute paths that ignore the ha_url path component. Useful exfiltration requires the target to return JSON at HA API paths, which is unlikely for non-HA services.
Code path 3 — WebSocket tool calls with forged token
The same forged token triggers WebSocket connections to ws://{ha_url}/api/websocket. The client follows the HA WebSocket handshake protocol (waits for auth_required, sends auth, expects auth_ok). Non-HA targets fail at the protocol level and return nothing useful. Realistic exploitation is limited to pivoting to another HA instance on the internal network.
Impact
Confirmed: Internal network reconnaissance via error oracle (all 3 code paths). An attacker can map reachable hosts and open ports from the server's network position.
Scope
OAuth mode is a beta feature, documented separately in docs/OAUTH.md and not part of the main setup instructions. The standard deployment method (pre-configured HOMEASSISTANT_URL and HOMEASSISTANT_TOKEN) is not affected.
Fix
Upgrade to 7.0.0
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "ha-mcp"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "7.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-32111"
],
"database_specific": {
"cwe_ids": [
"CWE-918"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-12T14:23:37Z",
"nvd_published_at": "2026-03-11T21:16:17Z",
"severity": "MODERATE"
},
"details": "### Summary\n\nThe ha-mcp OAuth consent form (beta feature) accepts a user-supplied `ha_url` and makes a server-side HTTP request to `{ha_url}/api/config` with no URL validation. An unauthenticated attacker can submit arbitrary URLs to perform internal network reconnaissance via an error oracle. Two additional code paths in OAuth tool calls (REST and WebSocket) are affected by the same primitive.\n\nThe primary deployment method (private URL with pre-configured `HOMEASSISTANT_TOKEN`) is not affected.\n\n### Details\n\n**Code path 1 \u2014 Consent form validation** (reported)\n\nWhen a user submits the OAuth consent form, `_validate_ha_credentials()` (`provider.py`) makes a server-side GET request to `{ha_url}/api/config` with no scheme, IP, or domain validation. Different exception types produce distinct error messages, creating an error oracle:\n\n| Outcome | Message returned | Information leaked |\n|---------|------------------|--------------------|\n| `ConnectError` | \"Could not connect...\" | Host down or port closed |\n| `TimeoutException` | \"Connection timed out...\" | Host up, port filtered |\n| HTTP 401 | \"Invalid access token...\" | Service alive, requires auth |\n| HTTP 403 | \"Access forbidden...\" | Service alive, forbidden |\n| HTTP \u2265 400 | \"Failed to connect: HTTP {N}\" | Service alive, exact status |\n\nAn attacker can drive the flow programmatically: register a client via open DCR (`POST /register`), initiate authorization, extract a `txn_id`, and submit arbitrary `ha_url` values. No user interaction required.\n\n**Code path 2 \u2014 REST tool calls with forged token**\n\nOAuth access tokens are stateless base64-encoded JSON payloads (`{\"ha_url\": \"...\", \"ha_token\": \"...\"}`). Since tokens are not signed, an attacker can forge a token with an arbitrary `ha_url`. REST tool calls then make HTTP requests to hardcoded HA API paths on that host (`/config`, `/states`, `/services`, etc.). JSON responses are returned to the caller.\n\nIn practice, path control is limited \u2014 most endpoints use absolute paths that ignore the `ha_url` path component. Useful exfiltration requires the target to return JSON at HA API paths, which is unlikely for non-HA services.\n\n**Code path 3 \u2014 WebSocket tool calls with forged token**\n\nThe same forged token triggers WebSocket connections to `ws://{ha_url}/api/websocket`. The client follows the HA WebSocket handshake protocol (waits for `auth_required`, sends `auth`, expects `auth_ok`). Non-HA targets fail at the protocol level and return nothing useful. Realistic exploitation is limited to pivoting to another HA instance on the internal network.\n\n### Impact\n\n**Confirmed:** Internal network reconnaissance via error oracle (all 3 code paths). An attacker can map reachable hosts and open ports from the server\u0027s network position.\n\n### Scope\n\nOAuth mode is a **beta** feature, documented separately in `docs/OAUTH.md` and not part of the main setup instructions. The standard deployment method (pre-configured `HOMEASSISTANT_URL` and `HOMEASSISTANT_TOKEN`) is not affected.\n\n### Fix\n\nUpgrade to 7.0.0",
"id": "GHSA-fmfg-9g7c-3vq7",
"modified": "2026-03-12T14:23:37Z",
"published": "2026-03-12T14:23:37Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-fmfg-9g7c-3vq7"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32111"
},
{
"type": "PACKAGE",
"url": "https://github.com/homeassistant-ai/ha-mcp"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "ha-mcp OAuth 2.1 DCR mode enables network reconnaissance via an error oracle"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.