ESPHome vulnerable to stored Cross-site Scripting in edit configuration file API
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| esphome | esphome | 2023.12.9 to before 2024.2.2 | 2024.2.2 | Patch available | CNA |
| — | esphome (PyPI) | 2023.12.9 to before 2024.2.2 | 2024.2.2 | Patch available | GHSA-9p43-hj5j-96h5 |
- esphome Vendoresphome Affected 2023.12.9 to before 2024.2.2 Fixed in 2024.2.2 Patch available CNA
- esphome (PyPI) Vendor— Affected 2023.12.9 to before 2024.2.2 Fixed in 2024.2.2 Patch available GHSA-9p43-hj5j-96h5
Remediation
- Fix · CNA esphome (esphome) Fixed in 2024.2.2
- Fix · GHSA-9p43-hj5j-96h5 esphome (PyPI) Fixed in 2024.2.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-27287
- 2026-10-03 Alias added: GHSA-9p43-hj5j-96h5
References
More Esphome vulnerabilities
- TI-2024-17944 ESPHome remote code execution via arbitrary file write CVSS 3.1HIGH 8.8
- TI-2026-19197 ESPHome vulnerable to denial-of-service via out-of-bounds check bypass in the API component CVSS 4.0LOW 1.7
Sources
- CVE-2024-27287 · CVE Program
- CVE-2024-27287 · NVD
- FIRST EPSS
- GHSA-9p43-hj5j-96h5 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences