Alta

ESPHome vulnerable to remote code execution via arbitrary file write

  • Publicada: 01.03.2024
  • Actualizado: 11.10.2026 15:17

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

<img width="482" alt="/edit?configuration=/config/.esphome/esphome.json" src="https://github.com/esphome/esphome/assets/115887876/d2da3180-976e-4bed-b4b9-35ac960a7fb4"> <br/> <img width="344" alt="/edit?configuration=/config/.esphome/build/test01/src/main.cpp (firmware for board named test01)" src="https://github.com/esphome/esphome/assets/115887876/707fb6d7-d4a8-461e-bbb7-05382471e925"> <br/> <img width="482" alt="RCE payload POST request on /edit?configuration=.esphome/platformio/packages/tool-esptoolpy/esptool.py" src="https://github.com/esphome/esphome/assets/115887876/c6cb28d8-352d-4fea-b77a-705f63be94e3"> <br/> <img width="482" alt="Arbitrary code execution during ESP board flashing" src="https://github.com/esphome/esphome/assets/115887876/5eb0f14c-ceb2-4b15-8898-c02c610763d1">

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

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) esphome >= 2023.12.9, < 2024.2.1 2024.2.1

Referencias

Puntuación CVSS 7.2/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Debilidad (CWE)
CWE-22
Plataforma
Python (PyPI)
Paquete
esphome
Publicada
01.03.2024
Actualizado
11.10.2026 15:17

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2026-1328 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-8p25-3q46-8q2p - CC BY 4.0

Historial de vulnerabilidades: esphome

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
6
Primera → última
09.2021 01.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Alta 4
  • Media 2

Divulgaciones por año

  1. 2021: 1
  2. 2022: 0
  3. 2023: 0
  4. 2024: 3
  5. 2025: 1
  6. 2026: 1
  1. Alta · 8.1 CVE-2024-29019 >= 2023.12.9, < 2024.3.0 2024.3.0
  2. Media · 6.5 CVE-2024-27287 >= 2023.12.9, < 2024.2.2 2024.2.2
  3. ESPHome vulnerable to remote code execution via arbitrary file write esta entrada
    Alta · 7.2 CVE-2024-27081 >= 2023.12.9, < 2024.2.1 2024.2.1
  4. Alta · 7.5 CVE-2021-41104 < 2021.9.2 2021.9.2

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.