GHSA-g39v-cvjh-8fpf: Home Assistant MCP Server YAML Config Backups Written Under Vulnerability
MODERATEGHSA-g39v-cvjh-8fpf is a MODERATE (CVSS 6.5) yaml config backups written under vulnerability (CWE-552: Files or Directories Accessible to External Parties) affecting Home Assistant MCP Server libraries in the PyPI ecosystem. The issue involves yaml config backups written under www/ are served unauthenticated at /local/. Remediation is available by upgrading affected packages to version 7.5.0.
GHSA-g39v-cvjh-8fpf at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix GHSA-g39v-cvjh-8fpf
To remediate this vulnerability, upgrade all affected Home Assistant MCP Server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install ha-mcp>=7.5.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ha-mcp
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-g39v-cvjh-8fpf, inspect your installed packages using pip:
pip show ha-mcp
Analyze the terminal output to locate any version of Home Assistant MCP Server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.5.0), your application is affected.
Note: The pip show ha-mcp command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-552: Files or Directories Accessible to External Parties, where the product makes files or directories accessible to unauthorized actors, even though they should not be. In Home Assistant MCP Server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-g39v-cvjh-8fpf Affected Home Assistant MCP Server Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ha-mcp
|
PyPI |
< 7.5.0
|
7.5.0
|
References
Frequently Asked Questions
What is GHSA-g39v-cvjh-8fpf?
Which Home Assistant MCP Server versions are affected?
What version fixes GHSA-g39v-cvjh-8fpf?
Is ha-mcp affected?
What is the CVSS score of GHSA-g39v-cvjh-8fpf?
What CWE is associated with GHSA-g39v-cvjh-8fpf?
How can I check PyPI dependencies for GHSA-g39v-cvjh-8fpf?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-g39v-cvjh-8fpf",
"modified" : "2026-05-14T20:17:23Z",
"published" : "2026-05-14T20:17:23Z",
"aliases" : [ ],
"summary" : "Home Assistant MCP Server: YAML config backups written under www/ are served unauthenticated at /local/",
"details" : "### 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ha-mcp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.5.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/homeassistant-ai/ha-mcp/security/advisories/GHSA-g39v-cvjh-8fpf"
}, {
"type" : "WEB",
"url" : "https://github.com/homeassistant-ai/ha-mcp/pull/1180"
}, {
"type" : "WEB",
"url" : "https://github.com/homeassistant-ai/ha-mcp/commit/09c524526b5f945638aa97de6218fadcd233023c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/homeassistant-ai/ha-mcp"
}, {
"type" : "WEB",
"url" : "https://github.com/homeassistant-ai/ha-mcp/releases/tag/v7.4.1.dev456"
}, {
"type" : "WEB",
"url" : "https://github.com/homeassistant-ai/ha-mcp/releases/tag/v7.5.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-552" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-14T20:17:23Z",
"nvd_published_at" : null
}
}