CVE-2025-62172
JSON

8.5high

Home Assistant vulnerable to Stored XSS in Energy dashboard from Energy Entity Name

Severity
8.5high CVSS:4.0 by GitHub_M
Exploit likelihood
0.43% (higher than 39% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-mq77-rv97-285mPYSEC-2026-1453

Description

Home Assistant is open source home automation software that puts local control and privacy first. In versions 2025.1.0 through 2025.10.1, the energy dashboard is vulnerable to stored cross-site scripting. An authenticated user can inject malicious JavaScript code into an energy entity's name field, which is then executed when any user hovers over data points in the energy dashboard graph tooltips. The vulnerability exists because entity names containing HTML are not properly sanitized before being rendered in graph tooltips. This could allow an attacker with authentication to execute arbitrary JavaScript in the context of other users' sessions. Additionally, if an energy provider (such as Tibber) supplies a malicious default name for an entity, the vulnerability can be exploited without direct user action when the default name is used. This issue has been patched in version 2025.10.2. No known workarounds exist.

Affected

Product or packageVersionsReported by
home-assistant core>= 2025.1.0, < 2025.10.2CVE List
homeassistant (PyPI)from 2025.1.0 before 2025.10.2GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M8.5high CVSS:4.0CVSS: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
GitHubhigh CVSS:4.0CVSS: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
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS: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

Classification

CWE-79CWE-80

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Home Assistant is open source home automation software that puts local control and privacy first. In versions 2025.1.0 through 2025.10.1, the energy dashboard is vulnerable to stored cross-site scripting. An authenticated user can inject malicious JavaScript code into an energy entity's name field, which is then executed when any user hovers over data points in the energy dashboard graph tooltips. The vulnerability exists because entity names containing HTML are not properly sanitized before being rendered in graph tooltips. This could allow an attacker with authentication to execute arbitrary JavaScript in the context of other users' sessions. Additionally, if an energy provider (such as Tibber) supplies a malicious default name for an entity, the vulnerability can be exploited without direct user action when the default name is used. This issue has been patched in version 2025.10.2. No known workarounds exist.

GitHub Advisory Database
Summary

An 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) 1_cens

An 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.

Details

The incriminating entity in my scenario is from the Tibber integration, as shown in the screenshot below: 2_cens

The 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:

image

Update found after issue was reported: I 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: 11_cens

Source code

The relevant source code is added in a comment, but copy pasted here as well:

The offending line of code rendering the payload appears to be: https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts#L110 Where the parameter marked with bold and italic is the vulnerable value: return `${title}${params.marker} ${params.seriesName}: ${value}`;

From 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, " ")_). We 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:

data.push({
  id: `${compare ? "compare-" : ""}${statId}-${type}`,
  type: "bar",
  cursor: "default",
  name:
    type in labels
      ? labels[type]
      : getStatisticLabel(
          this.hass,
          statId,
          statisticsMetaData[statId]
        ),

(https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts#L467-L478)

The value comes from:

  1. https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts#L467-L478 (This is the relevant call: getStatisticLabel(this.hass, statId, statisticsMetaData[statId];)

  2. 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);)

  3. computeStateName is defined here: https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/common/entity/compute_state_name.ts


PoC
  1. Set up a new energy provider with a price sensor.
  2. Give the price sensor a malicious name 4_cens
5_cens
  1. Configure the energy dashboard to get data from the price sensor image
7_cens 8_cens
  1. 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) 9_cens
Impact

It 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: 10_cens

This 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.

NVD (es)

Home Assistant es un software de automatización del hogar de código abierto que prioriza el control local y la privacidad. En las versiones 2025.1.0 a 2025.10.1, el panel de energía es vulnerable a cross-site scripting almacenado. Un usuario autenticado puede inyectar código JavaScript malicioso en el campo de nombre de una entidad de energía, el cual se ejecuta cuando cualquier usuario pasa el cursor sobre los puntos de datos en las descripciones emergentes del gráfico del panel de energía. La vulnerabilidad existe porque los nombres de las entidades que contienen HTML no se sanean correctamente antes de ser renderizados en las descripciones emergentes del gráfico. Esto podría permitir a un atacante con autenticación ejecutar JavaScript arbitrario en el contexto de las sesiones de otros usuarios. Además, si un proveedor de energía (como Tibber) suministra un nombre predeterminado malicioso para una entidad, la vulnerabilidad puede ser explotada sin acción directa del usuario cuando se utiliza el nombre predeterminado. Este problema ha sido parcheado en la versión 2025.10.2. No existen soluciones alternativas conocidas.

References

https://github.com/home-assistant/core/security/advisories/GHSA-mq77-rv97-285mweb
https://nvd.nist.gov/vuln/detail/CVE-2025-62172advisory
https://github.com/home-assistant/corepackage
https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/common/entity/compute_state_name.tsweb
https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/data/recorder.ts#L329-L339web
https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts#L110web
https://github.com/home-assistant/frontend/blob/c13a80ce5e7ae39f0262444e2b6295a074a96732/src/panels/lovelace/cards/energy/hui-energy-usage-graph-card.ts#L467-L478web
https://pypi.org/project/homeassistantpackage
https://github.com/advisories/GHSA-mq77-rv97-285madvisory

Related

Sources

SourceRecordLicence
CVE ListCVE-2025-62172 changed 2025-10-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-mq77-rv97-285m changed 2026-07-08CC-BY-4.0
NVDCVE-2025-62172 changed 2026-10-08Public domain
PyPA Advisory DatabasePYSEC-2026-1453 changed 2026-07-07CC-BY-4.0