CVE-2025-57808: Esphome ESP-IDF Web_server Basic Auth Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-mxh2-ccgj-8635
CVSS 8.1
CWE-187 CWE-303
Published
Advisory Summary

CVE-2025-57808 is a HIGH (CVSS 8.1) esp-idf web_server basic auth bypass vulnerability (CWE-187: Partial String Comparison) affecting Esphome libraries in the PyPI ecosystem. The issue involves esp-idf web_server basic auth bypass using empty or incomplete authorization header. Remediation is available by upgrading affected packages to version 2025.8.1.

CVE-2025-57808 at a Glance

CVE Identifier CVE-2025-57808
GHSA Identifier GHSA-mxh2-ccgj-8635
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-187: Partial String Comparison
Affected Product Esphome
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Adjacent (AV:A)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2025-57808

To remediate this vulnerability, upgrade all affected Esphome dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

esphome fixed: 2025.8.1
pip install esphome>=2025.8.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show esphome

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-57808, inspect your installed packages using pip:

pip show esphome

Analyze the terminal output to locate any version of Esphome in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2025.8.1), your application is affected.

Note: The pip show esphome command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-187: Partial String Comparison, where the product performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses. In Esphome, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary On 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. ### Details The 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`). Furthermore, 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`). ### PoC Configure ESPHome as follows: ```yaml esp32: board: ... framework: type: esp-idf web_server: auth: username: user password: somereallylongpass ``` In 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`.) You 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: ``` $ curl -D- http://example.local/ HTTP/1.1 401 Unauthorized ... $ curl -D- -H 'Authorization: Basic ' http://example.local/ HTTP/1.1 200 OK ... ``` ### Impact This 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. ### Remediation This vulnerability is fixed in 2025.8.1 and later. For older versions, disabling the `web_server` component on ESP-IDF devices may be prudent, particularly if OTA updates through `web_server` are enabled.

CVE-2025-57808 Affected Esphome Versions

1 component(s)
Fixed Versions:
2025.8.1
Product / Package Ecosystem Affected Versions Fixed Version
esphome
PyPI
< 2025.8.1
2025.8.1

References

Frequently Asked Questions

What is CVE-2025-57808?
CVE-2025-57808 is a security vulnerability in Esphome involving ESP-IDF web_server basic auth bypass using empty or incomplete Authorization header under CWE-187: Partial String Comparison.
Which Esphome versions are affected?
Affected versions include releases prior to 2025.8.1 across affected packages: esphome.
What version fixes CVE-2025-57808?
Upgrading to 2025.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is esphome affected?
Yes, esphome is affected in releases prior to 2025.8.1. Upgrade your dependency to 2025.8.1 or later.
What is the CVSS score of CVE-2025-57808?
CVE-2025-57808 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2025-57808?
CVE-2025-57808 is classified under CWE-187: Partial String Comparison (The product performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses.).
How can I check PyPI dependencies for CVE-2025-57808?
Run the dependency tree command: 'pip show esphome'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mxh2-ccgj-8635",
  "modified" : "2025-09-02T16:46:58Z",
  "published" : "2025-09-02T16:46:58Z",
  "aliases" : [ "CVE-2025-57808" ],
  "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "esphome"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2025.8.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2025.8.0"
    }
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-187", "CWE-303" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-02T16:46:58Z",
    "nvd_published_at" : "2025-09-02T01:15:29Z"
  }
}