Executive brief
The ESP32-audioI2S library, used for playing audio on ESP32 microcontrollers, contains a memory management flaw. An attacker can provide a specially crafted web address (URL) for an audio stream that causes the device to crash or potentially run unauthorized code. This could lead to a permanent service outage for the device or unauthorized access to sensitive data stored in memory.
Technical details
A heap-based buffer overflow exists in the Audio::connecttohost() function within src/Audio.cpp. The vulnerability is caused by the application concatenating untrusted extension paths and attacker-controlled query strings into a fixed-size ps_ptr heap buffer without validating the final string length. When the urlencode function is subsequently invoked, the resulting expanded string can exceed the buffer's capacity, leading to an out-of-bounds write on ESP32 PSRAM. A remote, unauthenticated attacker can exploit this by inducing the device to connect to a malicious audio stream URL, potentially resulting in arbitrary code execution, memory corruption, or a device crash (watchdog reboot). As of the advisory date, a vendor patch is reportedly under development.
Affected products
- schreibfaul1 ESP32-audioI2S 3.4.5
Timeline
- 2026-07-28: advisory: CVE-2026-51267 published by NVD/MITRE
- 2026-07-28: disclosed: Vulnerability details shared on GitHub by researcher