id: PYSEC-2026-1453
published: "2026-07-07T16:03:07.696647Z"
modified: "2026-07-07T17:24:18.857428Z"
aliases:
- CVE-2025-62172
- GHSA-mq77-rv97-285m
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
\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
\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
\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
\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
\n
\n\n\n3. Configure the energy dashboard to get data from the price sensor\n
\n\n
\n\n\n
\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
\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
\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."
affected:
- package:
name: homeassistant
ecosystem: PyPI
purl: pkg:pypi/homeassistant
ranges:
- type: ECOSYSTEM
events:
- introduced: 2025.1.0
- fixed: 2025.10.2
versions:
- 2025.1.0
- 2025.1.1
- 2025.1.2
- 2025.1.3
- 2025.1.4
- 2025.10.0
- 2025.10.0b0
- 2025.10.0b1
- 2025.10.0b2
- 2025.10.0b4
- 2025.10.0b5
- 2025.10.0b6
- 2025.10.0b7
- 2025.10.1
- 2025.2.0
- 2025.2.0b0
- 2025.2.0b1
- 2025.2.0b10
- 2025.2.0b11
- 2025.2.0b12
- 2025.2.0b2
- 2025.2.0b3
- 2025.2.0b4
- 2025.2.0b5
- 2025.2.0b6
- 2025.2.0b7
- 2025.2.0b8
- 2025.2.0b9
- 2025.2.1
- 2025.2.2
- 2025.2.3
- 2025.2.4
- 2025.2.5
- 2025.3.0
- 2025.3.0b0
- 2025.3.0b1
- 2025.3.0b2
- 2025.3.0b3
- 2025.3.0b4
- 2025.3.0b5
- 2025.3.0b6
- 2025.3.0b7
- 2025.3.0b8
- 2025.3.1
- 2025.3.2
- 2025.3.3
- 2025.3.4
- 2025.4.0
- 2025.4.0b0
- 2025.4.0b1
- 2025.4.0b10
- 2025.4.0b11
- 2025.4.0b12
- 2025.4.0b13
- 2025.4.0b14
- 2025.4.0b15
- 2025.4.0b2
- 2025.4.0b3
- 2025.4.0b4
- 2025.4.0b5
- 2025.4.0b6
- 2025.4.0b7
- 2025.4.0b8
- 2025.4.0b9
- 2025.4.1
- 2025.4.2
- 2025.4.3
- 2025.4.4
- 2025.5.0
- 2025.5.0b0
- 2025.5.0b1
- 2025.5.0b10
- 2025.5.0b2
- 2025.5.0b3
- 2025.5.0b4
- 2025.5.0b5
- 2025.5.0b6
- 2025.5.0b7
- 2025.5.0b8
- 2025.5.0b9
- 2025.5.1
- 2025.5.2
- 2025.5.3
- 2025.6.0
- 2025.6.0b0
- 2025.6.0b1
- 2025.6.0b2
- 2025.6.0b3
- 2025.6.0b4
- 2025.6.0b5
- 2025.6.0b6
- 2025.6.0b7
- 2025.6.0b8
- 2025.6.0b9
- 2025.6.1
- 2025.6.2
- 2025.6.3
- 2025.7.0
- 2025.7.0b0
- 2025.7.0b1
- 2025.7.0b2
- 2025.7.0b3
- 2025.7.0b4
- 2025.7.0b5
- 2025.7.0b6
- 2025.7.0b7
- 2025.7.0b8
- 2025.7.0b9
- 2025.7.1
- 2025.7.2
- 2025.7.3
- 2025.7.4
- 2025.8.0
- 2025.8.0b0
- 2025.8.0b1
- 2025.8.0b2
- 2025.8.0b3
- 2025.8.0b4
- 2025.8.0b5
- 2025.8.1
- 2025.8.2
- 2025.8.3
- 2025.9.0
- 2025.9.0b0
- 2025.9.0b1
- 2025.9.0b2
- 2025.9.0b3
- 2025.9.0b4
- 2025.9.0b5
- 2025.9.0b6
- 2025.9.1
- 2025.9.2
- 2025.9.3
- 2025.9.4
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"
- type: PACKAGE
url: https://pypi.org/project/homeassistant
- type: ADVISORY
url: https://github.com/advisories/GHSA-mq77-rv97-285m
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