{"id":"CVE-2025-57808","aliases":["CVE-2025-57808","GHSA-mxh2-ccgj-8635","PYSEC-2026-1330"],"related":[],"kind":"vulnerability","state":"published","title":"ESP-IDF web_server basic auth bypass using empty or incomplete Authorization header","summary":"ESPHome is a system to control microcontrollers remotely through Home Automation systems. In version 2025.8.0 in the ESP-IDF platform, ESPHome's web_server authentication check can pass incorrectly when the client-supplied base64-encoded Authorization value is empty or is a substring of the correct value. This allows access to web_server functionality (including OTA, if enabled) without knowing any information about the correct username or password. This issue has been patched in version 2025.8.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"ESPHome is a system to control microcontrollers remotely through Home Automation systems. In version 2025.8.0 in the ESP-IDF platform, ESPHome's web_server authentication check can pass incorrectly when the client-supplied base64-encoded Authorization value is empty or is a substring of the correct value. This allows access to web_server functionality (including OTA, if enabled) without knowing any information about the correct username or password. This issue has been patched in version 2025.8.1.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"ESPHome es un sistema para controlar microcontroladores remotamente a través de sistemas de automatización del hogar. En la versión 2025.8.0 en la plataforma ESP-IDF, la comprobación de autenticación del web_server de ESPHome puede ser superada incorrectamente cuando el valor de autorización codificado en base64 proporcionado por el cliente está vacío o es una subcadena del valor correcto. Esto permite el acceso a la funcionalidad del web_server (incluyendo OTA, si está habilitado) sin conocer ninguna información sobre el nombre de usuario o la contraseña correctos. Este problema ha sido parcheado en la versión 2025.8.1.","source":"nvd"}],"published":"2025-09-02T00:26:09.017Z","modified":"2026-10-19T17:10:00.173Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"}],"cwes":["CWE-187","CWE-303"],"affected":[{"ranges":[{"version":"= 2025.8.0","status":"affected"}],"vendor":"esphome","product":"esphome","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2025.8.1"}],"ecosystem":"PyPI","package":"esphome","purl":"pkg:pypi/esphome","source":"ghsa"},{"ranges":[{"status":"affected","version":"2025.8.0"}],"vendor":"esphome","product":"esphome_firmware","cpe":"cpe:2.3:o:esphome:esphome_firmware:2025.8.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2025.8.1"}],"ecosystem":"PyPI","package":"esphome","purl":"pkg:pypi/esphome","source":"pysec"}],"references":[{"url":"https://github.com/esphome/esphome/security/advisories/GHSA-mxh2-ccgj-8635","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/esphome/esphome/commit/2aceb56606ec8afec5f49c92e140c8050a6ccbe5","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-57808","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/esphome/esphome","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/esphome","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-mxh2-ccgj-8635","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-09-02T14:03:56.354Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-57808","url":"https://www.cve.org/CVERecord?id=CVE-2025-57808","licence":"CVE Terms of Use","modified":"2025-09-02T14:03:58.777Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mxh2-ccgj-8635","url":"https://github.com/advisories/GHSA-mxh2-ccgj-8635","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:28.586Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-57808","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-57808","licence":"Public domain","modified":"2026-10-19T17:10:00.173Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1330","url":"https://osv.dev/vulnerability/PYSEC-2026-1330","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:44.705Z"}],"updatedAt":"2026-11-25T22:59:03.981Z","epss":{"score":0.01549,"percentile":0.75797,"date":"2026-12-01T12:00:22.000Z"}}