CVE-2026-71259

ESPHome external_components file:// Scheme Validation Bypass Leading to Remote Code Execution

Published Aug 5, 2026 CVSS 3.1 · 8.6 High EPSS < 1% KEV · Not listed
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).

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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 available
History
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).
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Esphome
Esphome esphome
Vendors & Products Esphome
Esphome esphome
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'}

Weaknesses
  • CWE-184

    Incomplete List of Disallowed Inputs

Sources

Status
PUBLISHED
Assigner
TuranSec
Published
Updated
Aug 10, 2026, 11:46 AM
Reserved
Aug 5, 2026, 12:23 PM
Status
Deferred
Published
Aug 5, 2026, 1:24 PM
Modified
Aug 26, 2026, 5:13 PM