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… (CVE-2026-71259)
ESPHome versions through 2026.7.0-dev contain an operator-precedence bug in the cv.url() validator function. This bug causes file:// URIs to bypass proper validation, allowing an attacker to specify a local file path in the external_components YAML directive. When processed, this can lead to cloning attacker-controlled local repositories and executing arbitrary Python code during configuration processing.
AI Analysis
Technical Summary
The vulnerability in ESPHome arises from an operator-precedence error in the cv.url() validator in esphome/config_validation.py. The conditional statement `if parsed.scheme and parsed.netloc or parsed.scheme == "file"` incorrectly validates any file:// URI regardless of netloc due to the precedence of 'and' over 'or'. This validator is used for the 'url:' field of the external_components YAML directive's git source schema, which is passed to 'git clone'. An attacker can craft a malicious external_components block with a file:// URL pointing to a local attacker-controlled path. This path is cloned and added to Python's import system by ESPHome's component loader, resulting in arbitrary Python code execution when the YAML configuration is processed (e.g., via 'esphome config' or 'esphome run').
Potential Impact
Successful exploitation allows an attacker with the ability to modify the YAML configuration to execute arbitrary Python code locally on the system running ESPHome. This can lead to full compromise of the host, including confidentiality, integrity, and availability impacts. The CVSS v3.1 score is 8.6 (High), reflecting local attack vector with low complexity, no privileges required, user interaction required, scope change, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid processing untrusted or unauthenticated YAML configurations containing external_components directives with URLs. Restrict access to configuration files and limit who can run ESPHome commands that process YAML configurations to trusted users only.
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… (CVE-2026-71259)
Description
ESPHome versions through 2026.7.0-dev contain an operator-precedence bug in the cv.url() validator function. This bug causes file:// URIs to bypass proper validation, allowing an attacker to specify a local file path in the external_components YAML directive. When processed, this can lead to cloning attacker-controlled local repositories and executing arbitrary Python code during configuration processing.
CVSS v3.1
Score 8.6high
Affected software
pkg:github/esphome/esphomeRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in ESPHome arises from an operator-precedence error in the cv.url() validator in esphome/config_validation.py. The conditional statement `if parsed.scheme and parsed.netloc or parsed.scheme == "file"` incorrectly validates any file:// URI regardless of netloc due to the precedence of 'and' over 'or'. This validator is used for the 'url:' field of the external_components YAML directive's git source schema, which is passed to 'git clone'. An attacker can craft a malicious external_components block with a file:// URL pointing to a local attacker-controlled path. This path is cloned and added to Python's import system by ESPHome's component loader, resulting in arbitrary Python code execution when the YAML configuration is processed (e.g., via 'esphome config' or 'esphome run').
Potential Impact
Successful exploitation allows an attacker with the ability to modify the YAML configuration to execute arbitrary Python code locally on the system running ESPHome. This can lead to full compromise of the host, including confidentiality, integrity, and availability impacts. The CVSS v3.1 score is 8.6 (High), reflecting local attack vector with low complexity, no privileges required, user interaction required, scope change, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid processing untrusted or unauthenticated YAML configurations containing external_components directives with URLs. Restrict access to configuration files and limit who can run ESPHome commands that process YAML configurations to trusted users only.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-2g7j-rv69-9w67
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-71259"]
- Ecosystems
- []
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a738529bf8831d5394f023f
Added to database: 08/05/2026, 18:47:05 UTC
Last enriched: 08/05/2026, 18:56:35 UTC
Last updated: 08/05/2026, 23:19:59 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.