{"url":"http://public2.vulnerablecode.io/api/packages/964878?format=json","purl":"pkg:pypi/ha-mcp@4.7.1","type":"pypi","namespace":"","name":"ha-mcp","version":"4.7.1","qualifiers":{},"subpath":"","is_vulnerable":true,"next_non_vulnerable_version":"7.5.0","latest_non_vulnerable_version":"7.5.0","affected_by_vulnerabilities":[{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/360269?format=json","vulnerability_id":"VCID-3n4g-6616-73hu","summary":"Home Assistant MCP Server: YAML config backups written under www/ are served unauthenticated at /local/\n### Summary\n\nWhen `ENABLE_YAML_CONFIG_EDITING=true`, every `ha_config_set_yaml` call backs up the pre-edit file to `<config>/www/yaml_backups/`, which Home Assistant serves at `/local/` with **no authentication**. Anyone who can reach the HA web interface can download the most recent pre-edit `configuration.yaml` (or other YAML file) — typically containing plaintext MQTT passwords, REST credentials, webhook IDs, geofence coordinates, and `shell_command` definitions — with zero credentials.\n\n### Details\n\nThe backup feature is good — `do_backup` defaults to `True` and protects users from a bad edit. The issue is the location:\n\n- `custom_components/ha_mcp_tools/__init__.py:596` — `backup_dir = config_dir / \"www\" / \"yaml_backups\"`\n- `custom_components/ha_mcp_tools/__init__.py:602` — `backup_file = backup_dir / f\"{safe_name}.{timestamp}.bak\"`\n- `custom_components/ha_mcp_tools/__init__.py:606-607,692-693` — backup path returned to caller and logged at INFO\n\n`<config>/www/` is `/local/` and HA serves it unauthenticated by design (intended for static dashboard assets). An attacker discovers the path three ways: (1) it's returned to the MCP client in `result[\"backup_path\"]`; (2) it's logged at INFO and recoverable via `ha_get_logs`; (3) the timestamp format is `%Y%m%d_%H%M%S` — 86,400 candidates per day, enumerable. Backups accumulate (no rotation), so a long-running install holds a chronological history.\n\n**Preconditions:** `ENABLE_YAML_CONFIG_EDITING=true` (off by default), at least one YAML edit made, and the attacker can reach HA's port 8123 (LAN, or internet via Nabu Casa / reverse proxy).\n\n### PoC\n\nA pytest E2E test against a fresh Docker HA container with the custom component installed (using the project's existing `ha_container_with_fresh_config` fixture):\n\n```\n[1] ha_config_set_yaml(yaml_path=\"template\", action=\"add\", ...) → success=True\n[1] backup_path = 'www/yaml_backups/configuration.yaml.20260505_171335.bak'\n[2] GET http://<ha>:8123/local/yaml_backups/configuration.yaml.20260505_171335.bak\n    (no Authorization header)\n[2] HTTP 200, 440 bytes — the full pre-edit configuration.yaml\n[control] GET /api/config without auth → HTTP 401\n```\n\nThe control proves the result is meaningful: the same instance returns 401 for an authenticated endpoint; only `/local/` is unauthenticated by HA design.\n\n### Impact\n\nCWE-552 (Files or Directories Accessible to External Parties). Affects users with `ENABLE_YAML_CONFIG_EDITING=true` who have made at least one YAML edit. Anyone who can reach HA port 8123 reads the most recent pre-edit config without credentials. CVSS 6.5 medium (`AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`); 7.5 high if HA is internet-exposed.\n\n### Resolution\n\nFixed in `7.4.1.dev456` (PR #1180). The fix relocates new backups to `<config>/.ha_mcp_tools_backups/` (config root, not served by `/local/`) and adds a one-time migration on integration setup that moves any pre-existing exposed backups, surfaces a persistent notification telling the user to rotate exposed secrets, and removes the legacy directory if empty.\n\nThe fix ships in the next biweekly stable release and is available immediately on the dev channel. Updating to a release containing the fix is sufficient — no manual action required for users who upgrade.\n\n### Manual cleanup (for users who cannot upgrade yet)\n\nIf you used `ha_config_set_yaml` on a vulnerable version and cannot wait for the next stable release, manually remove the exposed backups:\n\n```\nrm -rf <config>/www/yaml_backups/\n```\n\nThen rotate any secrets that may have been in the YAML files those backups captured (MQTT/REST credentials, webhook IDs, `shell_command` definitions, geofence coordinates). The directory is reachable at `http(s)://<ha-host>:8123/local/yaml_backups/` until removed. After the next addon/package upgrade containing the fix, the integration will run this cleanup automatically and surface a persistent notification with the same rotation guidance.","references":[{"reference_url":"https://github.com/homeassistant-ai/ha-mcp","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/homeassistant-ai/ha-mcp"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp/commit/09c524526b5f945638aa97de6218fadcd233023c","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/homeassistant-ai/ha-mcp/commit/09c524526b5f945638aa97de6218fadcd233023c"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp/pull/1180","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/homeassistant-ai/ha-mcp/pull/1180"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp/releases/tag/v7.4.1.dev456","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/homeassistant-ai/ha-mcp/releases/tag/v7.4.1.dev456"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp/releases/tag/v7.5.0","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/homeassistant-ai/ha-mcp/releases/tag/v7.5.0"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-g39v-cvjh-8fpf","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"},{"value":"MODERATE","scoring_system":"cvssv3.1_qr","scoring_elements":""},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-g39v-cvjh-8fpf"},{"reference_url":"https://github.com/advisories/GHSA-g39v-cvjh-8fpf","reference_id":"GHSA-g39v-cvjh-8fpf","reference_type":"","scores":[{"value":"MODERATE","scoring_system":"cvssv3.1_qr","scoring_elements":""}],"url":"https://github.com/advisories/GHSA-g39v-cvjh-8fpf"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/375415?format=json","purl":"pkg:pypi/ha-mcp@7.5.0","is_vulnerable":false,"affected_by_vulnerabilities":[],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/ha-mcp@7.5.0"}],"aliases":["GHSA-g39v-cvjh-8fpf"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-3n4g-6616-73hu"},{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/77151?format=json","vulnerability_id":"VCID-6gnh-bzxj-cyht","summary":"ha-mcp is a Home Assistant MCP Server. Prior to 7.0.0, 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. This vulnerability is fixed in 7.0.0.","references":[{"reference_url":"https://api.first.org/data/v1/epss?cve=CVE-2026-32111","reference_id":"","reference_type":"","scores":[{"value":"0.00042","scoring_system":"epss","scoring_elements":"0.13189","published_at":"2026-06-12T12:55:00Z"},{"value":"0.00042","scoring_system":"epss","scoring_elements":"0.13092","published_at":"2026-06-11T12:55:00Z"}],"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-32111"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp","reference_id":"","reference_type":"","scores":[{"value":"5.3","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/homeassistant-ai/ha-mcp"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32111","reference_id":"","reference_type":"","scores":[{"value":"5.3","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32111"},{"reference_url":"https://github.com/advisories/GHSA-fmfg-9g7c-3vq7","reference_id":"GHSA-fmfg-9g7c-3vq7","reference_type":"","scores":[{"value":"MODERATE","scoring_system":"cvssv3.1_qr","scoring_elements":""}],"url":"https://github.com/advisories/GHSA-fmfg-9g7c-3vq7"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-fmfg-9g7c-3vq7","reference_id":"GHSA-fmfg-9g7c-3vq7","reference_type":"","scores":[{"value":"5.3","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"},{"value":"MODERATE","scoring_system":"cvssv3.1_qr","scoring_elements":""},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:N/A:Y/T:P/P:M/B:A/M:M/D:T/2026-03-12T14:02:25Z/"}],"url":"https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-fmfg-9g7c-3vq7"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/375290?format=json","purl":"pkg:pypi/ha-mcp@7.0.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-3n4g-6616-73hu"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/ha-mcp@7.0.0"}],"aliases":["CVE-2026-32111","GHSA-fmfg-9g7c-3vq7"],"risk_score":3.1,"exploitability":"0.5","weighted_severity":"6.2","resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-6gnh-bzxj-cyht"},{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/77110?format=json","vulnerability_id":"VCID-c667-z6da-w7h4","summary":"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.","references":[{"reference_url":"https://api.first.org/data/v1/epss?cve=CVE-2026-32112","reference_id":"","reference_type":"","scores":[{"value":"0.00037","scoring_system":"epss","scoring_elements":"0.11497","published_at":"2026-06-12T12:55:00Z"},{"value":"0.00037","scoring_system":"epss","scoring_elements":"0.11422","published_at":"2026-06-11T12:55:00Z"}],"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-32112"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp","reference_id":"","reference_type":"","scores":[{"value":"6.8","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/homeassistant-ai/ha-mcp"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32112","reference_id":"","reference_type":"","scores":[{"value":"6.8","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32112"},{"reference_url":"https://github.com/advisories/GHSA-pf93-j98v-25pv","reference_id":"GHSA-pf93-j98v-25pv","reference_type":"","scores":[{"value":"MODERATE","scoring_system":"cvssv3.1_qr","scoring_elements":""}],"url":"https://github.com/advisories/GHSA-pf93-j98v-25pv"},{"reference_url":"https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-pf93-j98v-25pv","reference_id":"GHSA-pf93-j98v-25pv","reference_type":"","scores":[{"value":"6.8","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"},{"value":"MODERATE","scoring_system":"cvssv3.1_qr","scoring_elements":""},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:N/A:N/T:T/P:M/B:A/M:M/D:T/2026-03-12T14:05:22Z/"}],"url":"https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-pf93-j98v-25pv"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/375290?format=json","purl":"pkg:pypi/ha-mcp@7.0.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-3n4g-6616-73hu"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/ha-mcp@7.0.0"}],"aliases":["CVE-2026-32112","GHSA-pf93-j98v-25pv"],"risk_score":3.1,"exploitability":"0.5","weighted_severity":"6.2","resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-c667-z6da-w7h4"}],"fixing_vulnerabilities":[],"risk_score":"3.1","resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/ha-mcp@4.7.1"}