Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-8p25-3q46-8q2p

Опубликовано: 01 мар. 2024
Источник: github
Github: Прошло ревью
CVSS3: 7.2

Описание

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.

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

/edit?configuration=/config/.esphome/esphome.json
/edit?configuration=/config/.esphome/build/test01/src/main.cpp (firmware for board named test01)
RCE payload POST request on /edit?configuration=.esphome/platformio/packages/tool-esptoolpy/esptool.py
Arbitrary code execution during ESP board flashing

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

Пакеты

Наименование

esphome

pip
Затронутые версииВерсия исправления

= 2023.12.9

2024.2.1

EPSS

Процентиль: 90%
0.05348
Низкий

7.2 High

CVSS3

Дефекты

CWE-22

Связанные уязвимости

CVSS3: 7.2
nvd
почти 2 года назад

ESPHome is a system to control your ESP8266/ESP32. A security misconfiguration in the edit configuration file API in the 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. This vulnerability is patched in 2024.2.1.

EPSS

Процентиль: 90%
0.05348
Низкий

7.2 High

CVSS3

Дефекты

CWE-22