GHSA-fmfg-9g7c-3vq7

Suggest an improvement
Source
https://github.com/advisories/GHSA-fmfg-9g7c-3vq7
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-fmfg-9g7c-3vq7/GHSA-fmfg-9g7c-3vq7.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-fmfg-9g7c-3vq7
Aliases
Published
2026-03-12T14:23:37Z
Modified
2026-03-14T02:39:00.312527Z
Severity
  • 5.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N CVSS Calculator
Summary
ha-mcp OAuth 2.1 DCR mode enables network reconnaissance via an error oracle
Details

Summary

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

Database specific
{
    "nvd_published_at": "2026-03-11T21:16:17Z",
    "severity": "MODERATE",
    "github_reviewed": true,
    "cwe_ids": [
        "CWE-918"
    ],
    "github_reviewed_at": "2026-03-12T14:23:37Z"
}
References

Affected packages

PyPI / ha-mcp

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
7.0.0

Affected versions

3.*
3.3.0
3.3.1
3.3.2
3.4.0
3.4.2
3.4.3
3.5.0
3.5.1
3.6.0
3.6.1
3.6.2
3.7.0
4.*
4.0.0
4.0.1
4.1.0
4.2.0
4.3.0
4.4.0
4.5.0
4.6.0
4.7.0
4.7.1
4.7.2
4.7.3
4.7.4
4.7.5
4.7.6
4.7.7
4.8.0
4.8.1
4.8.2
4.8.3
4.8.4
4.8.5
4.9.0
4.10.0
4.11.0
4.11.1
4.11.2
4.11.3
4.11.4
4.11.5
4.11.6
4.11.7
4.11.8
4.11.9
4.12.0
4.13.0
4.14.0
4.14.1
4.14.2
4.15.0
4.15.1
4.16.0
4.16.1
4.16.2
4.17.0
4.17.1
4.18.0
4.18.1
4.18.2
4.19.0
4.20.0
4.21.0
4.22.0
4.22.1
5.*
5.0.0
5.0.2
5.0.3
5.0.4
5.0.5
5.0.6
5.1.0
6.*
6.0.0
6.1.0
6.2.0
6.3.0
6.3.1
6.4.0
6.5.0
6.6.0
6.6.1
6.7.0
6.7.1
6.7.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-fmfg-9g7c-3vq7/GHSA-fmfg-9g7c-3vq7.json"