Description
ESPHome through 2026.7.0-dev contains an operator-precedence bug in the cv.url validator in esphome/config_validation.py. Because binds tighter than , any file: URI passes validation regardless of netloc. This validator gates the field of the external_components YAML directive's git source schema, which is passed to (git supports file:// natively).
Published: 2026-08-05
Score: 8.6 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is an operator‑precedence bug in ESPHome’s URL validator used by the external_components feature, corresponding to CWE-184: Incorrect Evaluation of Boolean Expressions. Because the binding operator evaluates tighter than the comparison, any file URI passes validation regardless of its netloc. This validator gate‑checks the field of the external_components YAML directive’s git source schema, which is passed to git, which supports file:// natively. As ESPHome’s component loader streams the cloned repository into Python’s import machinery, a maliciously crafted YAML configuration can cause arbitrary Python code to be loaded and executed when the configuration is processed by commands such as esphome config or esphome run.

Affected Systems

This flaw impacts the ESPHome platform, including the 2026.7.0‑dev release and earlier builds that have not applied the patch. The vulnerability is present in the main repository hosted at esphome/esphome and is tracked in the file esphome/config_validation.py.

Risk and Exploitability

With a CVSS score of 8.6 this flaw, identified as a CWE-184 operator‑precedence bug, is high severity. The EPSS score indicates a very low exploitation probability of < 1% and the flaw is not listed in the CISA KEV catalog, indicating it has not yet been exploited in the wild. Exploitation requires the attacker to inject a malicious external_components block containing a file:// URI that points to a local path on the system running ESPHome, enabling the attacker to clone and execute arbitrary code during configuration validation.

Generated by OpenCVE AI on August 10, 2026 at 21:08 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update ESPHome to a released version that includes the patch for the URL validator (CWE-184: Incorrect Evaluation of Boolean Expressions), which corrects the operator precedence and rejects unsafe file:// usage.
  • If an update is not feasible, remove or replace any external_components sections that reference file:// URIs; limit external_components to trusted remote repositories such as https:// or git://, and sanitize or delete the URL field before processing to mitigate the CWE-184 flaw.
  • As an interim manual fix, edit esphome/config_validation.py to add an explicit check that rejects file:// schemes when a netloc is present, for example by ensuring parsed.scheme == "file" and not parsed.netloc before returning the URL, thus addressing the CWE-184 operator‑precedence bug.

Generated by OpenCVE AI on August 10, 2026 at 21:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 10 Aug 2026 12:00:00 +0000

Type Values Removed Values Added
Description ESPHome through 2026.7.0-dev contains an operator-precedence bug in the cv.url() validator in esphome/config_validation.py: `if parsed.scheme and parsed.netloc or parsed.scheme == "file": return parsed.geturl()`. Because `and` binds tighter than `or`, any file: URI passes validation regardless of netloc. This validator gates the `url:` field of the external_components YAML directive's git source schema, which is passed to `git clone` (git supports file:// natively). A crafted `external_components` block with `url: "file:///attacker/repo"` clones an attacker-controlled local path, which is then added to Python's import machinery via ESPHome's component loader, executing arbitrary Python code when the YAML configuration is processed (e.g. via `esphome config`/`esphome run`). ESPHome through 2026.7.0-dev contains an operator-precedence bug in the cv.url validator in esphome/config_validation.py. Because binds tighter than , any file: URI passes validation regardless of netloc. This validator gates the field of the external_components YAML directive's git source schema, which is passed to (git supports file:// natively).

Wed, 05 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 05 Aug 2026 15:00:00 +0000

Type Values Removed Values Added
First Time appeared Esphome
Esphome esphome
Vendors & Products Esphome
Esphome esphome

Wed, 05 Aug 2026 13:15:00 +0000

Type Values Removed Values Added
Description ESPHome through 2026.7.0-dev contains an operator-precedence bug in the cv.url() validator in esphome/config_validation.py: `if parsed.scheme and parsed.netloc or parsed.scheme == "file": return parsed.geturl()`. Because `and` binds tighter than `or`, any file: URI passes validation regardless of netloc. This validator gates the `url:` field of the external_components YAML directive's git source schema, which is passed to `git clone` (git supports file:// natively). A crafted `external_components` block with `url: "file:///attacker/repo"` clones an attacker-controlled local path, which is then added to Python's import machinery via ESPHome's component loader, executing arbitrary Python code when the YAML configuration is processed (e.g. via `esphome config`/`esphome run`).
Title ESPHome external_components file:// Scheme Validation Bypass Leading to Remote Code Execution
Weaknesses CWE-184
References
Metrics cvssV3_1

{'score': 8.6, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H'}


cve-icon MITRE

Status: PUBLISHED

Assigner: TuranSec

Published:

Updated: 2026-08-10T11:46:20.128Z

Reserved: 2026-08-05T12:23:34.966Z

Link: CVE-2026-71259

cve-icon Vulnrichment

Updated: 2026-08-05T15:29:27.291Z

cve-icon NVD

Status : Deferred

Published: 2026-08-05T13:24:49.993

Modified: 2026-08-26T17:13:24.800

Link: CVE-2026-71259

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-10T21:15:07Z

Weaknesses
  • CWE-184

    Incomplete List of Disallowed Inputs