CVE-2021-41104: Esphome Basic Auth Bypass Vulnerability
HIGHCVE-2021-41104 is a HIGH (CVSS 7.5) basic auth bypass vulnerability (CWE-306: Missing Authentication for Critical Function) affecting Esphome libraries in the PyPI ecosystem. The issue involves basic auth bypass in esphome. Remediation is available by upgrading affected packages to version 2021.9.2.
CVE-2021-41104 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2021-41104
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.
pip install esphome>=2021.9.2
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-2021-41104, 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 2021.9.2), 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-306: Missing Authentication for Critical Function, where the product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. 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
CVE-2021-41104 Affected Esphome Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
esphome
|
PyPI |
< 2021.9.2
|
2021.9.2
|
References
Frequently Asked Questions
What is CVE-2021-41104?
Which Esphome versions are affected?
What version fixes CVE-2021-41104?
Is esphome affected?
What is the CVSS score of CVE-2021-41104?
What CWE is associated with CVE-2021-41104?
How can I check PyPI dependencies for CVE-2021-41104?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-48mj-p7x2-5jfm",
"modified" : "2024-09-20T17:35:20Z",
"published" : "2021-09-29T17:09:14Z",
"aliases" : [ "CVE-2021-41104" ],
"summary" : "Basic auth bypass in esphome",
"details" : "### Impact\n\nAnyone with web_server enabled and HTTP basic auth configured on 2021.9.1 or older\n\n`web_server` allows OTA update without checking user defined basic auth username & password\n\n### Patches\n\nPatch released in 2021.9.2\n\n### Workarounds\n\nDisable/remove `web_server`\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "esphome"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2021.9.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/esphome/esphome/security/advisories/GHSA-48mj-p7x2-5jfm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41104"
}, {
"type" : "WEB",
"url" : "https://github.com/esphome/esphome/pull/2409"
}, {
"type" : "WEB",
"url" : "https://github.com/esphome/esphome/commit/2234f6aacf8cc653307fed80f3750317a82c4f83"
}, {
"type" : "WEB",
"url" : "https://github.com/esphome/esphome/commit/be965a60eba6bb769e2a5afdbc8eed132f077a59"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/esphome/esphome"
}, {
"type" : "WEB",
"url" : "https://github.com/esphome/esphome/releases/tag/2021.9.2"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/esphome/PYSEC-2021-351.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-306" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-09-28T21:10:08Z",
"nvd_published_at" : "2021-09-28T16:15:00Z"
}
}