CVE-2025-62172: Homeassistant Cross-Site Scripting Vulnerability
HIGHCVE-2025-62172 is a HIGH cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Homeassistant libraries in the PyPI ecosystem. The issue involves home assistant has stored xss vulnerability in energy dashboard from energy entity name. Remediation is available by upgrading affected packages to version 2025.10.2.
CVE-2025-62172 at a Glance
How to Fix CVE-2025-62172
To remediate this vulnerability, upgrade all affected Homeassistant 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 homeassistant>=2025.10.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show homeassistant
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-62172, inspect your installed packages using pip:
pip show homeassistant
Analyze the terminal output to locate any version of Homeassistant in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2025.10.2), your application is affected.
Note: The pip show homeassistant command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Homeassistant, 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
CVE-2025-62172 Affected Homeassistant Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
homeassistant
|
PyPI |
≥ 2025.1.0
< 2025.10.2
|
2025.10.2
|
References
Frequently Asked Questions
What is CVE-2025-62172?
Which Homeassistant versions are affected?
What version fixes CVE-2025-62172?
Is homeassistant affected?
What CWE is associated with CVE-2025-62172?
How can I check PyPI dependencies for CVE-2025-62172?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mq77-rv97-285m",
"modified" : "2026-03-27T21:39:44Z",
"published" : "2025-10-14T19:36:53Z",
"aliases" : [ "CVE-2025-62172" ],
"summary" : "Home Assistant has Stored XSS vulnerability in Energy dashboard from Energy Entity Name",
"details" : "### Summary\nAn authenticated party can add a malicious name to the Energy entity, allowing for Cross-Site Scripting attacks against anyone who can see the Energy dashboard, when they hover over any information point (The blue bar in the picture below)\n<img width=\"955\" height=\"568\" alt=\"1_cens\" src=\"https://github.com/user-attachments/assets/ed855216-c306-4b50-affc-cda100e72b74\" />\n\n\nAn alternative, and more impactful scenario, is that the entity gets a malicious name from the provider of the Entity (in this case the energy provider: Tibber), and gets exploited that way, through the default name.\n\n\n### Details\nThe incriminating entity in my scenario is from the Tibber integration, as shown in the screenshot below:\n<img width=\"822\" height=\"309\" alt=\"2_cens\" src=\"https://github.com/user-attachments/assets/d0d5a7aa-8d0c-4dcb-825b-e4cb8ea8885b\" />\n\n\nThe exploit should be possible regardless of the Energy integration, as the user can name the entity themselves and as such pick a malicious name. The default name given by the Energy integration can also be taken directly from their system, and be vulnerable that way. The execution happens within the energy dashboard, when hovering over a data point:\n\n<img width=\"1545\" height=\"571\" alt=\"image\" src=\"https://github.com/user-attachments/assets/46dc7f00-4593-4271-8c3f-4c02b021ff2b\" />\n\n\n**Update found after issue was reported:**\nI found that the issue presents itself for any entity with a html-entity in the name, which is included and rendered in the graph view. Following is an example for a speaker:\n<img width=\"423\" height=\"96\" alt=\"11_cens\" src=\"https://github.com/user-attachments/assets/3b4d43dd-d9e0-466b-85c0-277af3195acf\" />\n\n##### Source code\nThe relevant source code is added in a comment, but copy pasted here as well:\n\nThe offending line of code rendering the payload appears to be:\nhttps://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts#L110\nWhere the parameter marked with bold and italic is the vulnerable value:\nreturn \\`${title}${params.marker} **_${params.seriesName}_**: ${value}\\`;\n\n\nFrom the trace below, we can see that the only change done to the friendly_name of an entity is replacing underscores with spaces (_computeObjectId(entityId).replace(/_/g, \" \")_).\nWe can also determine that any power entity will have it's name used if there is one, and fall back to the friendly name if it cannot find one:\n```\ndata.push({\n id: `${compare ? \"compare-\" : \"\"}${statId}-${type}`,\n type: \"bar\",\n cursor: \"default\",\n name:\n type in labels\n ? labels[type]\n : getStatisticLabel(\n this.hass,\n statId,\n statisticsMetaData[statId]\n ),\n```\n(https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts#L467-L478)\n\n\nThe value comes from:\n\n1. https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts#L467-L478 \n(This is the relevant call: _getStatisticLabel(this.hass, statId, statisticsMetaData[statId];_)\n\n2. getStatisticLabel is defined here: https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/data/recorder.ts#L329-L339 (This is the relevant call: _computeStateName(entity);_)\n\n3. computeStateName is defined here: https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/common/entity/compute_state_name.ts\n\n\n-----\n\n### PoC\n1. Set up a new energy provider with a price sensor.\n2. Give the price sensor a malicious name \n<img width=\"814\" height=\"100\" alt=\"4_cens\" src=\"https://github.com/user-attachments/assets/64bf7a00-47a2-46db-ae0f-b93e328837d2\" />\n<img width=\"459\" height=\"325\" alt=\"5_cens\" src=\"https://github.com/user-attachments/assets/e43e1c4f-bb4e-45b4-b46a-a6fc32b689ba\" />\n\n\n3. Configure the energy dashboard to get data from the price sensor\n<img width=\"582\" height=\"394\" alt=\"image\" src=\"https://github.com/user-attachments/assets/74c99ab8-0842-4c1b-b2e9-994827d89609\" />\n\n<img width=\"1678\" height=\"241\" alt=\"7_cens\" src=\"https://github.com/user-attachments/assets/24f4c83a-3c0a-4dea-9e1c-9c6b070fb28f\" />\n\n\n<img width=\"329\" height=\"497\" alt=\"8_cens\" src=\"https://github.com/user-attachments/assets/ccb7f90a-4745-4fb4-9efa-f30b3324cb3a\" />\n\n\n5. Look at the data and hover the data point for code to execute. (You may have to trigger data ingestion or add a false data point to be able to hover a data point when testing, you need at least one datapoint to trigger the vulnerability)\n<img width=\"1547\" height=\"575\" alt=\"9_cens\" src=\"https://github.com/user-attachments/assets/087cdf78-a503-427d-8e0c-bb5db24de5c8\" />\n\n\n### Impact\nIt is possible to exploit this over the internet, by using an energy provider, like Tibber, with a malicious name, and relying on the default naming in Home Assistant being used. This is actually how I found this bug:\n<img width=\"453\" height=\"152\" alt=\"10_cens\" src=\"https://github.com/user-attachments/assets/45451efb-2688-4589-a988-88d1fc0b4e25\" />\n\nThis means that a malicious employee or someone with access to your electricity provider can attack your Home Assistant instance from your electricity provider. I am unsure if you consider this a sanitization and escaping issue in the respective integrations or not, but I believe a central fix in the form of fixing the Energy Dashboard is more appropriate, rather than to rely on every integration properly handling user input.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "homeassistant"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2025.1.0"
}, {
"fixed" : "2025.10.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2025.10.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/home-assistant/core/security/advisories/GHSA-mq77-rv97-285m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-62172"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/home-assistant/core"
}, {
"type" : "WEB",
"url" : "https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/common/entity/compute_state_name.ts"
}, {
"type" : "WEB",
"url" : "https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/data/recorder.ts#L329-L339"
}, {
"type" : "WEB",
"url" : "https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts#L110"
}, {
"type" : "WEB",
"url" : "https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts#L467-L478"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-10-14T19:36:53Z",
"nvd_published_at" : "2025-10-14T16:15:41Z"
}
}