CVE-2024-27081: ESPHome vulnerable to remote code execution via arbitrary file write
Summary Security misconfiguration in edit configuration file API in dashboard component of ESPHome version 2023.12.9 (command line installation) allows authenticated remote attackers to read and write arbitrary files under the configuration directory rendering remote code execution possible.
Published Mar 1, 2024 · Updated Mar 20, 2026
Affected packages
esphome
- Ecosystem
- PyPI
- Affected
- = 2023.12.9
- Fixed in
- 2024.2.1
- Check
pip show esphome
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Security misconfiguration in edit configuration file API in dashboard component of ESPHome version 2023.12.9 (command line installation) allows authenticated remote attackers to read and write arbitrary files under the configuration directory rendering remote code execution possible.
Details
It is possible to abuse this path traversal vulnerability both in command line installation and Home Assistant add-on, but it is possible to read and write files only under the configuration directory.
The vulnerability is present and exploitable in the command line installation, but it was not possible to confirm an impact in the home assistant add-on version.
PoC
Impact
The issue gives read and write access to files under the configuration directory and allows malicious users to write arbitrary code in python scripts executed during the compilation and flashing of firmwares for ESP boards.
If chained with GHSA-9p43-hj5j-96h5 and GHSA-5925-88xh-6h99, this issue could allow an unauthenticated remote user to gain remote code execution on the machine hosting the dashboard.
It also allows accessing sensitive information such as esphome.json and board firmware source code allowing a user to modify the board firmware, and leaking secrets such as: WiFi network credentials, fallback hotspot WiFi credentials, OTA component authentication password and API encryption key.
Credits
Spike Reply Cybersecurity Team
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-23833
ESPHome vulnerable to denial-of-service via out-of-bounds check bypass in the API component
medium6.8Jan 21, 2026CVE-2025-57808
ESP-IDF web_server basic auth bypass using empty or incomplete Authorization header
high8.1Sep 2, 2025CVE-2024-29019
ESPHome vulnerable to Authentication bypass via Cross site request forgery
high8.1Mar 21, 2024CVE-2024-27287
esphome vulnerable to stored Cross-site Scripting in edit configuration file API
medium6.5Mar 6, 2024
