Media

ha-mcp OAuth 2.1 DCR mode enables network reconnaissance via an error oracle

  • Publicada: 12.03.2026
  • Actualizado: 11.10.2026 14:17

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

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) ha-mcp < 7.0.0 7.0.0

Referencias

Puntuación CVSS 5.3/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Debilidad (CWE)
CWE-918
Plataforma
Python (PyPI)
Paquete
ha-mcp
Publicada
12.03.2026
Actualizado
11.10.2026 14:17

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2026-2507 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-fmfg-9g7c-3vq7 - CC BY 4.0

Historial de vulnerabilidades: ha-mcp

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
4
Primera → última
03.2026 07.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Media 4

Divulgaciones por año

  1. 2026: 4
  1. Media · 6.8 CVE-2026-32112 < 7.0.0 7.0.0
  2. ha-mcp OAuth 2.1 DCR mode enables network reconnaissance via an error oracle esta entrada
    Media · 5.3 CVE-2026-32111 < 7.0.0 7.0.0

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.