# CVE-2024-27287: ESPHome vulnerable to stored Cross-site Scripting in edit configuration file API

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.68%, higher than 53% of CVEs (2026-12-01)
- Published: 2024-03-06T15:28:21.000Z
- Modified: 2026-07-07T17:57:03.701Z
- Also known as: GHSA-9p43-hj5j-96h5, PYSEC-2026-1329
- Related: CVE-2024-29019
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

ESPHome is a system to control your ESP8266/ESP32 for Home Automation systems. Starting in version 2023.12.9 and prior to version 2024.2.2, editing the configuration file API in dashboard component of ESPHome version 2023.12.9 (command line installation and Home Assistant add-on) serves unsanitized data with `Content-Type: text/html; charset=UTF-8`, allowing a remote authenticated user to inject arbitrary web script and exfiltrate session cookies via Cross-Site scripting. It is possible for a malicious authenticated user to inject arbitrary Javascript in configuration files using a POST request to the /edit endpoint, the configuration parameter allows to specify the file to write. To trigger the XSS vulnerability, the victim must visit the page` /edit?configuration=[xss file]`. Abusing this vulnerability a malicious actor could perform operations on the dashboard on the behalf of a logged user, access sensitive information, create, edit and delete configuration files and flash firmware on managed boards.
In addition to this, cookies are not correctly secured, allowing the exfiltration of session cookie values. Version 2024.2.2 contains a patch for this issue.

(As written by CVE List.)

## Affected

- esphome esphome: >= 2023.12.9, < 2024.2.2; from 2023.12.9 before 2024.2.2
- esphome (PyPI): from 2023.12.9 before 2024.2.2

## Every score

- GitHub_M: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N`
- NVD: CVSS:3.1 8.7 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N`
- PyPA Advisory Database: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N`

## References

- <https://github.com/esphome/esphome/security/advisories/GHSA-9p43-hj5j-96h5> (technical-description, vendor-advisory, web)
- <https://github.com/esphome/esphome/commit/37d2b3c7977a4ccbec59726ca7549cb776661455> (patch, web)
- <https://github.com/esphome/esphome> (package)
- <https://pypi.org/project/esphome> (package)
- <https://github.com/advisories/GHSA-9p43-hj5j-96h5> (advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-27287> (advisory)

## Sources

- CVE List: [CVE-2024-27287](https://www.cve.org/CVERecord?id=CVE-2024-27287), CVE Terms of Use, modified 2024-08-26
- GitHub Advisory Database: [GHSA-9p43-hj5j-96h5](https://github.com/advisories/GHSA-9p43-hj5j-96h5), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2024-27287](https://nvd.nist.gov/vuln/detail/CVE-2024-27287), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1329](https://osv.dev/vulnerability/PYSEC-2026-1329), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2024-27287 · Whole record: https://cve.day/CVE-2024-27287.json · Rebuilt by cve.day 2026-11-25T22:58:37.308Z
