{"id":"PYSEC-2026-1330","summary":"ESP-IDF web_server basic auth bypass using empty or incomplete Authorization header","details":"### Summary\nOn the ESP-IDF platform, ESPHome's [`web_server` authentication](https://esphome.io/components/web_server.html#configuration-variables) check can pass incorrectly when the client-supplied base64-encoded `Authorization` value is empty or is a substring of the correct value (e.g., correct username with partial password). This allows access to `web_server` functionality (including OTA, if enabled) without knowing any information about the correct username or password.\n\n### Details\nThe HTTP basic auth check in `web_server_idf`'s [`AsyncWebServerRequest::authenticate`](https://github.com/esphome/esphome/blob/ef2121a215890d46dc1d25ad363611ecadc9e25e/esphome/components/web_server_idf/web_server_idf.cpp#L256) only compares up to `auth.value().size() - auth_prefix_len` bytes of the base64-encoded `user:pass` string. This means a client-provided valuer like `dXNlcjpz` (`user:s`) will pass the check when the correct value is much longer, e.g., `dXNlcjpzb21lcmVhbGx5bG9uZ3Bhc3M=` (`user:somereallylongpass`).\n\nFurthermore, the check will also pass when the supplied value is the empty string, which removes the need to know (or brute force) the username. A browser won't generally issue such a request, but it can easily be done by manually constructing the `Authorizaztion` request header (e.g., via `curl`).\n\n### PoC\nConfigure ESPHome as follows:\n\n```yaml\nesp32:\n  board: ...\n  framework:\n    type: esp-idf\nweb_server:\n  auth:\n    username: user\n    password: somereallylongpass\n```\n\nIn a browser, you can correctly log in by supplying username `user` and password `somereallylongpass`... but you can _also_ incorrectly log in by supplying _substrings_ of the password whose base64-encoded digest matches a _prefix_ of the correct digest. (For example, I was able to log into an ESPHome device so configured by supplying password `some`... or even just `s`.)\n\nYou can also use a tool like `curl` to manually set an `Authorization` request header that _always_ passes the check without any knowledge of the username:\n\n```\n$ curl -D- http://example.local/\nHTTP/1.1 401 Unauthorized\n...\n\n$ curl -D- -H 'Authorization: Basic ' http://example.local/\nHTTP/1.1 200 OK\n...\n```\n\n### Impact\nThis vulnerability effectively nullifies basic auth support for the ESP-IDF `web_server`, allowing auth bypass from another device on the local network with no knowledge of the correct username or password required.\n\n### Remediation\nThis vulnerability is fixed in 2025.8.1 and later.\n\nFor older versions, disabling the `web_server` component on ESP-IDF devices may be prudent, particularly if OTA updates through `web_server` are enabled.","aliases":["CVE-2025-57808","GHSA-mxh2-ccgj-8635"],"modified":"2026-07-07T17:46:44.705589787Z","published":"2026-07-07T16:03:02.901251Z","references":[{"type":"WEB","url":"https://github.com/esphome/esphome/security/advisories/GHSA-mxh2-ccgj-8635"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-57808"},{"type":"WEB","url":"https://github.com/esphome/esphome/commit/2aceb56606ec8afec5f49c92e140c8050a6ccbe5"},{"type":"PACKAGE","url":"https://github.com/esphome/esphome"},{"type":"PACKAGE","url":"https://pypi.org/project/esphome"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-mxh2-ccgj-8635"}],"affected":[{"package":{"name":"esphome","ecosystem":"PyPI","purl":"pkg:pypi/esphome"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2025.8.1"}]}],"versions":["1.10.1","1.11.0","1.11.0b1","1.11.0b2","1.11.0b3","1.11.1","1.11.2","1.12.0","1.12.0b1","1.12.0b2","1.12.0b3","1.12.0b4","1.12.1","1.12.2","1.13.0","1.13.0b1","1.13.0b2","1.13.0b3","1.13.0b4","1.13.0b5","1.13.0b6","1.13.0b7","1.13.1","1.13.2","1.13.3","1.13.4","1.13.5","1.13.6","1.14.0","1.14.0b1","1.14.0b2","1.14.0b3","1.14.0b4","1.14.0b5","1.14.1","1.14.2","1.14.3","1.14.4","1.14.5","1.15.0","1.15.0b1","1.15.0b2","1.15.0b3","1.15.0b4","1.15.1","1.15.2","1.15.3","1.16.0","1.16.0b1","1.16.0b2","1.16.0b3","1.16.0b4","1.16.0b5","1.16.0b6","1.16.0b7","1.16.0b8","1.16.1","1.16.2","1.17.0","1.17.0b1","1.17.1","1.17.2","1.18.0","1.18.0b1","1.18.0b2","1.18.0b3","1.18.0b4","1.19.0","1.19.0b1","1.19.0b2","1.19.0b3","1.19.0b4","1.19.0b5","1.19.0b6","1.19.0b7","1.19.1","1.19.2","1.19.3","1.19.4","1.20.0","1.20.0b1","1.20.0b2","1.20.0b3","1.20.0b4","1.20.0b5","1.20.0b6","1.20.1","1.20.2","1.20.3","1.20.4","1.21.0b1","1.21.0b2","1.21.0b3","2021.10.0","2021.10.0b1","2021.10.0b10","2021.10.0b11","2021.10.0b2","2021.10.0b3","2021.10.0b4","2021.10.0b5","2021.10.0b6","2021.10.0b7","2021.10.0b8","2021.10.0b9","2021.10.1","2021.10.2","2021.10.3","2021.11.0","2021.11.0b1","2021.11.0b2","2021.11.0b3","2021.11.0b4","2021.11.0b5","2021.11.0b6","2021.11.0b7","2021.11.0b8","2021.11.0b9","2021.11.1","2021.11.2","2021.11.3","2021.11.4","2021.12.0","2021.12.0b1","2021.12.0b2","2021.12.0b3","2021.12.0b4","2021.12.0b5","2021.12.0b6","2021.12.1","2021.12.2","2021.12.3","2021.8.0","2021.8.1","2021.8.2","2021.9.0","2021.9.0b1","2021.9.0b2","2021.9.0b3","2021.9.0b4","2021.9.0b5","2021.9.1","2021.9.2","2021.9.3","2022.1.0","2022.1.0b1","2022.1.0b2","2022.1.0b3","2022.1.0b4","2022.1.1","2022.1.2","2022.1.3","2022.1.4","2022.10.0","2022.10.0b1","2022.10.0b2","2022.10.1","2022.10.2","2022.11.0","2022.11.0b1","2022.11.0b2","2022.11.0b3","2022.11.0b4","2022.11.0b5","2022.11.0b6","2022.11.1","2022.11.2","2022.11.3","2022.11.4","2022.11.5","2022.12.0","2022.12.0b1","2022.12.0b2","2022.12.0b3","2022.12.0b4","2022.12.0b5","2022.12.0b6","2022.12.1","2022.12.2","2022.12.3","2022.12.4","2022.12.5","2022.12.6","2022.12.7","2022.12.8","2022.2.0","2022.2.0b1","2022.2.0b2","2022.2.0b3","2022.2.1","2022.2.2","2022.2.3","2022.2.4","2022.2.5","2022.2.6","2022.3.0","2022.3.0b1","2022.3.0b2","2022.3.1","2022.3.2","2022.4.0","2022.4.0b1","2022.4.0b2","2022.4.0b3","2022.4.0b4","2022.5.0","2022.5.0b1","2022.5.0b2","2022.5.0b3","2022.5.0b4","2022.5.1","2022.6.0","2022.6.0b1","2022.6.0b2","2022.6.0b3","2022.6.0b4","2022.6.1","2022.6.2","2022.6.3","2022.8.0","2022.8.0b1","2022.8.0b2","2022.8.0b3","2022.8.1","2022.8.2","2022.8.3","2022.9.0","2022.9.0b1","2022.9.0b2","2022.9.0b3","2022.9.0b4","2022.9.0b5","2022.9.1","2022.9.2","2022.9.3","2022.9.4","2023.10.0","2023.10.0b1","2023.10.0b2","2023.10.0b3","2023.10.0b4","2023.10.1","2023.10.2","2023.10.3","2023.10.4","2023.10.5","2023.10.6","2023.11.0","2023.11.0b1","2023.11.0b2","2023.11.0b3","2023.11.0b4","2023.11.0b5","2023.11.0b6","2023.11.0b7","2023.11.1","2023.11.2","2023.11.3","2023.11.4","2023.11.5","2023.11.6","2023.12.0","2023.12.0b1","2023.12.0b2","2023.12.0b3","2023.12.0b4","2023.12.0b5","2023.12.0b6","2023.12.1","2023.12.2","2023.12.3","2023.12.4","2023.12.5","2023.12.6","2023.12.7","2023.12.8","2023.12.9","2023.2.0","2023.2.0b1","2023.2.0b2","2023.2.0b3","2023.2.0b4","2023.2.0b5","2023.2.1","2023.2.2","2023.2.3","2023.2.4","2023.3.0","2023.3.0b1","2023.3.0b2","2023.3.0b3","2023.3.0b4","2023.3.0b5","2023.3.0b6","2023.3.1","2023.3.2","2023.4.0","2023.4.0b1","2023.4.0b2","2023.4.0b3","2023.4.0b4","2023.4.1","2023.4.2","2023.4.3","2023.4.4","2023.5.0","2023.5.0b1","2023.5.0b2","2023.5.0b3","2023.5.0b4","2023.5.0b5","2023.5.1","2023.5.2","2023.5.3","2023.5.4","2023.5.5","2023.6.0","2023.6.0b1","2023.6.0b2","2023.6.0b3","2023.6.0b4","2023.6.0b5","2023.6.0b6","2023.6.0b7","2023.6.1","2023.6.2","2023.6.3","2023.6.4","2023.6.5","2023.7.0","2023.7.0b1","2023.7.0b2","2023.7.0b3","2023.7.1","2023.8.0","2023.8.0b1","2023.8.0b2","2023.8.0b3","2023.8.0b4","2023.8.1","2023.8.2","2023.8.3","2023.9.0","2023.9.0b1","2023.9.0b2","2023.9.0b3","2023.9.0b4","2023.9.1","2023.9.2","2023.9.3","2024.10.0","2024.10.0b1","2024.10.0b2","2024.10.1","2024.10.2","2024.10.3","2024.11.0","2024.11.0b1","2024.11.0b2","2024.11.0b3","2024.11.0b4","2024.11.1","2024.11.2","2024.11.3","2024.12.0","2024.12.0b1","2024.12.0b2","2024.12.0b3","2024.12.1","2024.12.2","2024.12.3","2024.12.4","2024.2.0","2024.2.0b1","2024.2.0b2","2024.2.0b3","2024.2.1","2024.2.2","2024.3.0","2024.3.0b1","2024.3.0b2","2024.3.0b3","2024.3.0b4","2024.3.0b5","2024.3.1","2024.3.2","2024.4.0","2024.4.0b1","2024.4.0b2","2024.4.0b3","2024.4.1","2024.4.2","2024.5.0","2024.5.0b1","2024.5.0b2","2024.5.0b3","2024.5.0b4","2024.5.0b5","2024.5.0b6","2024.5.1","2024.5.2","2024.5.3","2024.5.4","2024.5.5","2024.6.0","2024.6.0b1","2024.6.0b2","2024.6.0b3","2024.6.0b4","2024.6.0b5","2024.6.1","2024.6.2","2024.6.3","2024.6.4","2024.6.5","2024.6.6","2024.7.0","2024.7.0b1","2024.7.0b2","2024.7.0b3","2024.7.0b4","2024.7.1","2024.7.2","2024.7.3","2024.8.0","2024.8.0b1","2024.8.0b2","2024.8.0b3","2024.8.0b4","2024.8.1","2024.8.2","2024.8.3","2024.9.0","2024.9.0b1","2024.9.0b2","2024.9.0b3","2024.9.0b4","2024.9.1","2024.9.2","2025.2.0","2025.2.0b1","2025.2.0b2","2025.2.0b3","2025.2.0b4","2025.2.0b5","2025.2.0b6","2025.2.1","2025.2.2","2025.3.0","2025.3.0b1","2025.3.0b2","2025.3.0b3","2025.3.0b4","2025.3.0b5","2025.3.1","2025.3.2","2025.3.3","2025.4.0","2025.4.0b1","2025.4.0b2","2025.4.0b3","2025.4.1","2025.4.2","2025.5.0","2025.5.0b2","2025.5.0b3","2025.5.0b4","2025.5.0b5","2025.5.0b6","2025.5.1","2025.5.2","2025.6.0","2025.6.0b1","2025.6.0b2","2025.6.0b3","2025.6.1","2025.6.2","2025.6.3","2025.7.0","2025.7.0b1","2025.7.0b2","2025.7.0b3","2025.7.0b4","2025.7.0b5","2025.7.1","2025.7.2","2025.7.3","2025.7.4","2025.7.5","2025.8.0","2025.8.0b1","2025.8.0b2","2025.8.0b3","2025.8.0b4"],"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/esphome/PYSEC-2026-1330.yaml"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"}]}