GHSA-mxh2-ccgj-8635

Suggest an improvement
Source
https://github.com/advisories/GHSA-mxh2-ccgj-8635
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-mxh2-ccgj-8635/GHSA-mxh2-ccgj-8635.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mxh2-ccgj-8635
Aliases
Related
Published
2025-09-02T16:46:58Z
Modified
2025-09-02T17:12:32.501082Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N CVSS Calculator
Summary
ESP-IDF web_server basic auth bypass using empty or incomplete Authorization header
Details

Summary

On 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 (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 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:

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.

Database specific
{
    "github_reviewed": true,
    "github_reviewed_at": "2025-09-02T16:46:58Z",
    "severity": "HIGH",
    "nvd_published_at": "2025-09-02T01:15:29Z",
    "cwe_ids": [
        "CWE-187",
        "CWE-303"
    ]
}
References

Affected packages

PyPI / esphome

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2025.8.1

Affected versions

1.*
1.10.1
1.11.0b1
1.11.0b2
1.11.0b3
1.11.0
1.11.1
1.11.2
1.12.0b1
1.12.0b2
1.12.0b3
1.12.0b4
1.12.0
1.12.1
1.12.2
1.13.0b1
1.13.0b2
1.13.0b3
1.13.0b4
1.13.0b5
1.13.0b6
1.13.0b7
1.13.0
1.13.1
1.13.2
1.13.3
1.13.4
1.13.5
1.13.6
1.14.0b1
1.14.0b2
1.14.0b3
1.14.0b4
1.14.0b5
1.14.0
1.14.1
1.14.2
1.14.3
1.14.4
1.14.5
1.15.0b1
1.15.0b2
1.15.0b3
1.15.0b4
1.15.0
1.15.1
1.15.2
1.15.3
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.0
1.16.1
1.16.2
1.17.0b1
1.17.0
1.17.1
1.17.2
1.18.0b1
1.18.0b2
1.18.0b3
1.18.0b4
1.18.0
1.19.0b1
1.19.0b2
1.19.0b3
1.19.0b4
1.19.0b5
1.19.0b6
1.19.0b7
1.19.0
1.19.1
1.19.2
1.19.3
1.19.4
1.20.0b1
1.20.0b2
1.20.0b3
1.20.0b4
1.20.0b5
1.20.0b6
1.20.0
1.20.1
1.20.2
1.20.3
1.20.4
1.21.0b1
1.21.0b2
1.21.0b3
2021.*
2021.8.0
2021.8.1
2021.8.2
2021.9.0b1
2021.9.0b2
2021.9.0b3
2021.9.0b4
2021.9.0b5
2021.9.0
2021.9.1
2021.9.2
2021.9.3
2021.10.0b1
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.0b10
2021.10.0b11
2021.10.0
2021.10.1
2021.10.2
2021.10.3
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.0
2021.11.1
2021.11.2
2021.11.3
2021.11.4
2021.12.0b1
2021.12.0b2
2021.12.0b3
2021.12.0b4
2021.12.0b5
2021.12.0b6
2021.12.0
2021.12.1
2021.12.2
2021.12.3
2022.*
2022.1.0b1
2022.1.0b2
2022.1.0b3
2022.1.0b4
2022.1.0
2022.1.1
2022.1.2
2022.1.3
2022.1.4
2022.2.0b1
2022.2.0b2
2022.2.0b3
2022.2.0
2022.2.1
2022.2.2
2022.2.3
2022.2.4
2022.2.5
2022.2.6
2022.3.0b1
2022.3.0b2
2022.3.0
2022.3.1
2022.3.2
2022.4.0b1
2022.4.0b2
2022.4.0b3
2022.4.0b4
2022.4.0
2022.5.0b1
2022.5.0b2
2022.5.0b3
2022.5.0b4
2022.5.0
2022.5.1
2022.6.0b1
2022.6.0b2
2022.6.0b3
2022.6.0b4
2022.6.0
2022.6.1
2022.6.2
2022.6.3
2022.8.0b1
2022.8.0b2
2022.8.0b3
2022.8.0
2022.8.1
2022.8.2
2022.8.3
2022.9.0b1
2022.9.0b2
2022.9.0b3
2022.9.0b4
2022.9.0b5
2022.9.0
2022.9.1
2022.9.2
2022.9.3
2022.9.4
2022.10.0b1
2022.10.0b2
2022.10.0
2022.10.1
2022.10.2
2022.11.0b1
2022.11.0b2
2022.11.0b3
2022.11.0b4
2022.11.0b5
2022.11.0b6
2022.11.0
2022.11.1
2022.11.2
2022.11.3
2022.11.4
2022.11.5
2022.12.0b1
2022.12.0b2
2022.12.0b3
2022.12.0b4
2022.12.0b5
2022.12.0b6
2022.12.0
2022.12.1
2022.12.2
2022.12.3
2022.12.4
2022.12.5
2022.12.6
2022.12.7
2022.12.8
2023.*
2023.2.0b1
2023.2.0b2
2023.2.0b3
2023.2.0b4
2023.2.0b5
2023.2.0
2023.2.1
2023.2.2
2023.2.3
2023.2.4
2023.3.0b1
2023.3.0b2
2023.3.0b3
2023.3.0b4
2023.3.0b5
2023.3.0b6
2023.3.0
2023.3.1
2023.3.2
2023.4.0b1
2023.4.0b2
2023.4.0b3
2023.4.0b4
2023.4.0
2023.4.1
2023.4.2
2023.4.3
2023.4.4
2023.5.0b1
2023.5.0b2
2023.5.0b3
2023.5.0b4
2023.5.0b5
2023.5.0
2023.5.1
2023.5.2
2023.5.3
2023.5.4
2023.5.5
2023.6.0b1
2023.6.0b2
2023.6.0b3
2023.6.0b4
2023.6.0b5
2023.6.0b6
2023.6.0b7
2023.6.0
2023.6.1
2023.6.2
2023.6.3
2023.6.4
2023.6.5
2023.7.0b1
2023.7.0b2
2023.7.0b3
2023.7.0
2023.7.1
2023.8.0b1
2023.8.0b2
2023.8.0b3
2023.8.0b4
2023.8.0
2023.8.1
2023.8.2
2023.8.3
2023.9.0b1
2023.9.0b2
2023.9.0b3
2023.9.0b4
2023.9.0
2023.9.1
2023.9.2
2023.9.3
2023.10.0b1
2023.10.0b2
2023.10.0b3
2023.10.0b4
2023.10.0
2023.10.1
2023.10.2
2023.10.3
2023.10.4
2023.10.5
2023.10.6
2023.11.0b1
2023.11.0b2
2023.11.0b3
2023.11.0b4
2023.11.0b5
2023.11.0b6
2023.11.0b7
2023.11.0
2023.11.1
2023.11.2
2023.11.3
2023.11.4
2023.11.5
2023.11.6
2023.12.0b1
2023.12.0b2
2023.12.0b3
2023.12.0b4
2023.12.0b5
2023.12.0b6
2023.12.0
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
2024.*
2024.2.0b1
2024.2.0b2
2024.2.0b3
2024.2.0
2024.2.1
2024.2.2
2024.3.0b1
2024.3.0b2
2024.3.0b3
2024.3.0b4
2024.3.0b5
2024.3.0
2024.3.1
2024.3.2
2024.4.0b1
2024.4.0b2
2024.4.0b3
2024.4.0
2024.4.1
2024.4.2
2024.5.0b1
2024.5.0b2
2024.5.0b3
2024.5.0b4
2024.5.0b5
2024.5.0b6
2024.5.0
2024.5.1
2024.5.2
2024.5.3
2024.5.4
2024.5.5
2024.6.0b1
2024.6.0b2
2024.6.0b3
2024.6.0b4
2024.6.0b5
2024.6.0
2024.6.1
2024.6.2
2024.6.3
2024.6.4
2024.6.5
2024.6.6
2024.7.0b1
2024.7.0b2
2024.7.0b3
2024.7.0b4
2024.7.0
2024.7.1
2024.7.2
2024.7.3
2024.8.0b1
2024.8.0b2
2024.8.0b3
2024.8.0b4
2024.8.0
2024.8.1
2024.8.2
2024.8.3
2024.9.0b1
2024.9.0b2
2024.9.0b3
2024.9.0b4
2024.9.0
2024.9.1
2024.9.2
2024.10.0b1
2024.10.0b2
2024.10.0
2024.10.1
2024.10.2
2024.10.3
2024.11.0b1
2024.11.0b2
2024.11.0b3
2024.11.0b4
2024.11.0
2024.11.1
2024.11.2
2024.11.3
2024.12.0b1
2024.12.0b2
2024.12.0b3
2024.12.0
2024.12.1
2024.12.2
2024.12.3
2024.12.4
2025.*
2025.2.0b1
2025.2.0b2
2025.2.0b3
2025.2.0b4
2025.2.0b5
2025.2.0b6
2025.2.0
2025.2.1
2025.2.2
2025.3.0b1
2025.3.0b2
2025.3.0b3
2025.3.0b4
2025.3.0b5
2025.3.0
2025.3.1
2025.3.2
2025.3.3
2025.4.0b1
2025.4.0b2
2025.4.0b3
2025.4.0
2025.4.1
2025.4.2
2025.5.0b2
2025.5.0b3
2025.5.0b4
2025.5.0b5
2025.5.0b6
2025.5.0
2025.5.1
2025.5.2
2025.6.0b1
2025.6.0b2
2025.6.0b3
2025.6.0
2025.6.1
2025.6.2
2025.6.3
2025.7.0b1
2025.7.0b2
2025.7.0b3
2025.7.0b4
2025.7.0b5
2025.7.0
2025.7.1
2025.7.2
2025.7.3
2025.7.4
2025.7.5
2025.8.0b1
2025.8.0b2
2025.8.0b3
2025.8.0b4
2025.8.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/09/GHSA-mxh2-ccgj-8635/GHSA-mxh2-ccgj-8635.json"
last_known_affected_version_range
"<= 2025.8.0"