Description
Hello! I think I have found two potential security issues in the OTA update protocol implemented by ArduinoOTA.cpp and espota.py. I have only analyzed and tested using the Arduino IDE update process, but it probably also affects the Web Browser, HTTP Server, and Stream Interface.
Basic Infos
A network user with eavesdropping capabilities can bypass the security mechanisms in place for the OTA Update Protocol using two different vulnerabilities.
Description
Mitigations
(1) Offline Password Brute Force - A proper password-based key derivation function (e.g. PBKDF2) and secure protocol using that derived key (e.g. using HMAC or CMAC) could fix the vulnerability. Using a strong password could mitigate the vulnerability. This should be made clear in the docs.
(2) Firmware Password Sniffing - Encrypted firmware delivery perhaps using a password-based key derivation function for the encryption key would fix the vulnerability.